JoseDavila
asked on
Data type mismatch in critia expression when sorting
I am trying to sort the TTLotID field, but I get the data type mismatch error. Why is that and how can I fix it?
SELECT CLng(Replace([Litho Data].[TTLotID],"-","")) AS LotID
FROM [Litho Data];
SELECT CLng(Replace([Litho Data].[TTLotID],"-","")) AS LotID
FROM [Litho Data];
ASKER
NO. It still has the same error.
You say you were trying to sort by the TTLotID field - I assume you mean you were trying to sort by the new LotID field?
ASKER
Correct.
Hmm. What version of Access and what service pack?
ASKER
2002.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is [TTLotID] in the table [Litho Date] a text field?
Patrick
Patrick
I presume the value of TTLotID after the replace is less than 2,147,483,647. That is the largest positive integer CLng will support.
SELECT CLng(Replace(Nz([Litho Data].[TTLotID],"0"),"-","
FROM [Litho Data];