I have a text field that contains numbers that I want to change to a numeric field during a make table query. (Please note that I do not not have the option of changing the original table's data type.) (Also, I'm using Access 2000.)
I've been searching forum posts and see people changing data types during queries with operators like CInt, CDbl, CLng. I've tried all of these and still get the error "data type mismatch in criteria expression." What am I doing wrong? I've also tried using Val, and that works, but it gives me extra records I don't want.
Here is my SQL code using CInt:
SELECT CInt([CONINFO]![Contract/PO #]) AS PONum, CONINFO.[Title/Description], CONINFO.[Spec Writer], CONINFO.[Award Date] INTO tblPOCAO
FROM CONINFO
WHERE (((CInt([CONINFO]![Contract/PO #])) Between [Enter low number range] And [Enter high number range]))
ORDER BY CInt([CONINFO]![Contract/PO #]);
Here is my SQL code without trying to change the data type:
SELECT CONINFO.[Contract/PO #] AS PONum, CONINFO.[Title/Description], CONINFO.[Spec Writer], CONINFO.[Award Date] INTO tblPOCAO
FROM CONINFO
WHERE (((CONINFO.[Contract/PO #]) Between [Enter low number range] And [Enter high number range]))
ORDER BY CONINFO.[Contract/PO #];
Thanks!
I've been searching forum posts and see people changing data types during queries with operators like CInt, CDbl, CLng. I've tried all of these and still get the error "data type mismatch in criteria expression." What am I doing wrong? I've also tried using Val, and that works, but it gives me extra records I don't want.
Here is my SQL code using CInt:
SELECT CInt([CONINFO]![Contract/PO #]) AS PONum, CONINFO.[Title/Description], CONINFO.[Spec Writer], CONINFO.[Award Date] INTO tblPOCAO
FROM CONINFO
WHERE (((CInt([CONINFO]![Contract/PO #])) Between [Enter low number range] And [Enter high number range]))
ORDER BY CInt([CONINFO]![Contract/PO #]);
Here is my SQL code without trying to change the data type:
SELECT CONINFO.[Contract/PO #] AS PONum, CONINFO.[Title/Description], CONINFO.[Spec Writer], CONINFO.[Award Date] INTO tblPOCAO
FROM CONINFO
WHERE (((CONINFO.[Contract/PO #]) Between [Enter low number range] And [Enter high number range]))
ORDER BY CONINFO.[Contract/PO #];
Thanks!