I've been trying to create a union query from two tables with a date field but when I sort by this field it treats it as a number...
Originally I had:
When I tried to sort the above it would put the dates in "number order"
So I tried (some dates are Null values)
This give me a data mismatch error. Any ideas??
Dave
Originally I had:
Code:
SELECT ALL [Estab] AS [ACC], [Industry],[PriceNet] AS [Value],Format([InvDate],"dd/mm/yyyy") AS [Date],[HCSC]
FROM [tblSCInternalSales]
UNION ALL SELECT [ACC],[Industry],[Value],Format([Date],"dd/mm/yyyy"), [HCSC]
FROM [qryHCInternalForUnion];
So I tried (some dates are Null values)
Code:
SELECT ALL [Estab]AS [ACC], [Industry],[PriceNet] AS [Value],Nz(CDate(Format([InvDate],"dd/mm/yyyy"))) AS [Date],[HCSC]
FROM [tblSCInternalSales]
UNION ALL SELECT [ACC],[Industry],[Value],Nz(CDate(Format([Date],"dd/mm/yyyy"))), [HCSC]
FROM [qryHCInternalForUnion];
This give me a data mismatch error. Any ideas??
Dave