Pergunta

I have the following query in access used in a report for data selection. It works except that it truncates the What_happened field.

The sql database has the what_happened field as a nvarchar(max) - access 2010 see's it as a memo field.

I need to be able to see the full contents of the what_happened field on the report form

Thank you,

Steve

SELECT DISTINCT dbo_all_clients_view.people_id,
                dbo_all_clients_view.full_name,
                dbo_event_log_shack.actual_date,
                dbo_all_clients_view.is_active_client,
                [dbo_all_clients_view query].policy_num,
                dbo_event_log_shack.event_log_id,
                dbo_all_clients_view.dob,
                dbo_event_log_shack.eventtime1,
                dbo_event_log_shack.is_deleted,
                dbo_event_log_shack.staff_name,
                dbo_event_log_shack.staff_supervisor,
                cir_descrip_staff_resp.what_happened
FROM   cir_descrip_staff_resp
       RIGHT JOIN ((dbo_all_clients_view
                    LEFT JOIN dbo_event_log_shack
                           ON dbo_all_clients_view.people_id =
                              dbo_event_log_shack.people_id)
                   LEFT JOIN [dbo_all_clients_view query]
                          ON dbo_all_clients_view.id_no =
[dbo_all_clients_view query].dbo_all_clients_view_id_no)
ON cir_descrip_staff_resp.[event id] = dbo_event_log_shack.event_log_id
WHERE  (( ( dbo_event_log_shack.is_deleted ) = false ))
ORDER  BY dbo_all_clients_view.full_name,
          dbo_event_log_shack.actual_date DESC; 
Foi útil?

Solução

A great many things cause memo fields to be truncated. In a report, you can DlookUp the memo or use another query to get the full text.

There is a pretty good list of possible reasons here: http://allenbrowne.com/ser-63.html

Outras dicas

I was looking for this answer as I knew I had found out how to fix this from a post a few years ago. I subsequently remembered how and it is the most excruciating bad bit of work I have known. As it seems to have been lost from the current knowledge I thought I would put it back out there.

When you are in the export window, click advanced. It shows a grid of field information. If you put your mouse over the 'Field name' heading and then move it right the cursor turns to a line with 2 arrows, move farther to the right and it turns to 2 lines with a space and 2 arrows. Click and drag right and you by magic get the skip field, go back to field name heading , do the same again and you magic the indexed, repeat and magic the width then the start and next time the data type. Ah the data type says it will be exported as a short text field, change it to long text and that is what it exports. If you are using import/export saved specs to put in your vba, you can similarly expose the data type it will be exported as. It works with older versions and it works with SQL server linked odbc tables. I've also just realised that those one field queries probably aren't needed either if you select the skip option for the ones you don't want. Hope this helps someeone :)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top