Dear All,
I have the following query which uses a date parameter within Excel to filter the data.
When run within Excel I get a error saying "String Data, Right truncation".
The problem appears to be the nested select statement, if I remove this part of the query it works fine.
Any ideas?
the query is as follows (no laughing I'm self taught!) : -
SELECT JOBOPER.JOBNUM, JOBOPER.OPCODE, JOBOPER.ESTPRODHOURS, JOBOPER.PRODLABRATE, (JOBOPER.ESTPRODHOURS*JOBOPER.PRODLABRATE)+JOBOPER.ESTUNITCOST, JOBOPER.ACTLABCOST, JOBOPER.OPCOMPLETE, JOBHEAD.PRODCODE,(SELECT TOP(1) EMPLOYEENUM FROM LABORDTL WHERE JOBNUM = LABORDTL.JOBNUM AND JOBOPER.OPCODE = LABORDTL.OPCODE AND NOT EMPLOYEENUM = 'DUMMY' ORDER BY LABORDTLSEQ DESC)
FROM JOBOPER, JOBHEAD
WHERE (JOBHEAD.CLOSEDDATE=?) AND
(JOBHEAD.JOBNUM=JOBOPER.JOBNUM) AND
(JOBHEAD.COMPANY='SF03') AND
(JOBHEAD.JOBNUM LIKE '5%') AND
SUBCONTRACT = 0
Thanks
Lee
I have the following query which uses a date parameter within Excel to filter the data.
When run within Excel I get a error saying "String Data, Right truncation".
The problem appears to be the nested select statement, if I remove this part of the query it works fine.
Any ideas?
the query is as follows (no laughing I'm self taught!) : -
SELECT JOBOPER.JOBNUM, JOBOPER.OPCODE, JOBOPER.ESTPRODHOURS, JOBOPER.PRODLABRATE, (JOBOPER.ESTPRODHOURS*JOBOPER.PRODLABRATE)+JOBOPER.ESTUNITCOST, JOBOPER.ACTLABCOST, JOBOPER.OPCOMPLETE, JOBHEAD.PRODCODE,(SELECT TOP(1) EMPLOYEENUM FROM LABORDTL WHERE JOBNUM = LABORDTL.JOBNUM AND JOBOPER.OPCODE = LABORDTL.OPCODE AND NOT EMPLOYEENUM = 'DUMMY' ORDER BY LABORDTLSEQ DESC)
FROM JOBOPER, JOBHEAD
WHERE (JOBHEAD.CLOSEDDATE=?) AND
(JOBHEAD.JOBNUM=JOBOPER.JOBNUM) AND
(JOBHEAD.COMPANY='SF03') AND
(JOBHEAD.JOBNUM LIKE '5%') AND
SUBCONTRACT = 0
Thanks
Lee