C
Christine Lisi
I have a column in my table called Record #. I need to perform queries on a
regular basis which include specific Record #'s. So I may need to select
over 200 specific record numbers in a query. This is turning into a
nightmare. Firstly, in design view I'm manually typing:
1404 Or 1289 Or 125 Or 284 Or 3329 Or 243 Or 3087 Or 235 Or 111 Or 12...
and on and on! The SQL query window looks something like this:
WHERE ((([Gift Cards].[Record #])=1404 Or ([Gift Cards].[Record #])=1291 Or
([Gift Cards].[Record #])=525 Or ([Gift Cards].[Record #])=526 Or ([Gift
Cards].[Record #])=1362 Or ([Gift Cards].[Record #])=1178 Or ([Gift
Cards].[Record #])=1182 Or ([Gift Cards].[Record #])=1174 Or ([Gift
Cards].[Record #])=1180 Or ([Gift Cards].[Record #])=1183 Or ([Gift
Cards].[Record #])=1179 Or ([Gift Cards].[Record #])=1181 Or ([Gift
Cards].[Record #])=353 Or ([Gift Cards].[Record #])=819 Or ([Gift
Cards].[Record #])=818 Or ([Gift Cards].[Record #])=1171 Or ([Gift
Cards].[Record #])=1173 Or ([Gift Cards].[Record #])=1172 Or ([Gift
Cards].[Record #])=690 Or ([Gift Cards].[Record #])=1210 Or ([Gift
Cards].[Record #])=1211 Or ([Gift Cards].[Record #])=1209 Or ([Gift
Cards].[Record #])=1121 Or ([Gift Cards].[Record #])=1002 Or ([Gift
Cards].[Record #])=966 Or ([Gift Cards].[Record #])=826 Or ([Gift
Cards].[Record #])=660 Or ([Gift Cards].[Record #])=661 Or ([Gift
Cards].[Record #])=943 Or ([Gift Cards].[Record #])=740 Or ([Gift
Cards].[Record #])=948 Or ([Gift Cards].[Record #])=542 Or ([Gift
Cards].[Record #])=1039 Or ([Gift Cards].[Record #])=699 Or ([Gift
Cards].[Record #])=1059 Or ([Gift Cards].[Record #])=1112 Or ([Gift
Cards].[Record #])=543 Or ([Gift Cards].[Record #])=713 Or ([Gift
Cards].[Record #])=1111 Or ([Gift Cards].[Record #])=1060 Or ([Gift
Cards].[Record #])=1113 Or ([Gift Cards].[Record #])=405 Or ([Gift
Cards].[Record #])=997 Or ([Gift Cards].[Record #])=504 Or ([Gift
Cards].[Record #])=1225 Or ([Gift Cards].[Record #])=1105 Or ([Gift
Cards].[Record #])=1107 Or ([Gift Cards].[Record #])=1106 Or ([Gift
Cards].[Record #])=958 Or ([Gift Cards].[Record #])=808 Or ([Gift
Cards].[Record #])=807 Or ([Gift Cards].[Record #])=1259 Or ([Gift
Cards].[Record #])=1119 Or ([Gift Cards].[Record #])=608 Or ([Gift
Cards].[Record #])=1055 Or ([Gift Cards].[Record #])=607 Or ([Gift
Cards].[Record #])=828 Or ([Gift Cards].[Record #])=824 Or ([Gift
Cards].[Record #])=1151 Or ([Gift Cards].[Record #])=1050 Or ([Gift
Cards].[Record #])=1287 Or ([Gift Cards].[Record #])=232 Or ([Gift
Cards].[Record #])=945 Or ([Gift Cards].[Record #])=1041 Or ([Gift
Cards].[Record #])=1040 Or ([Gift Cards].[Record #])=233 Or ([Gift
Cards].[Record #])=986 Or ([Gift Cards].[Record #])=927 Or ([Gift
Cards].[Record #])=830 Or ([Gift Cards].[Record #])=829 Or ([Gift
Cards].[Record #])=951 Or ([Gift Cards].[Record #])=950 Or ([Gift
Cards].[Record #])=894 Or ([Gift Cards].[Record #])=936 Or ([Gift
Cards].[Record #])=832 Or ([Gift Cards].[Record #])=1282 Or ([Gift
Cards].[Record #])=791 Or ([Gift Cards].[Record #])=792 Or ([Gift
Cards].[Record #])=793 Or ([Gift Cards].[Record #])=794 Or ([Gift
Cards].[Record #])=797 Or ([Gift Cards].[Record #])=235 Or ([Gift
Cards].[Record #])=1421 Or ([Gift Cards].[Record #])=1054 Or ([Gift
Cards].[Record #])=1212 Or ([Gift Cards].[Record #])=940 Or ([Gift
Cards].[Record #])=941 Or ([Gift Cards].[Record #])=1057 Or ([Gift
Cards].[Record #])=896 Or ([Gift Cards].[Record #])=416 Or ([Gift
Cards].[Record #])=912 Or ([Gift Cards].[Record #])=407 Or ([Gift
Cards].[Record #])=406 Or ([Gift Cards].[Record #])=408 Or ([Gift
Cards].[Record #])=886 Or ([Gift Cards].[Record #])=885))
There has got to be an easier way to accomplish this. I thought about
creating a new column in my table called TEMP and making it a Yes/No field
and checking the fields of the records I need and doing the query that way,
but this will not work because I need to save these queries.
Can anyone help?
regular basis which include specific Record #'s. So I may need to select
over 200 specific record numbers in a query. This is turning into a
nightmare. Firstly, in design view I'm manually typing:
1404 Or 1289 Or 125 Or 284 Or 3329 Or 243 Or 3087 Or 235 Or 111 Or 12...
and on and on! The SQL query window looks something like this:
WHERE ((([Gift Cards].[Record #])=1404 Or ([Gift Cards].[Record #])=1291 Or
([Gift Cards].[Record #])=525 Or ([Gift Cards].[Record #])=526 Or ([Gift
Cards].[Record #])=1362 Or ([Gift Cards].[Record #])=1178 Or ([Gift
Cards].[Record #])=1182 Or ([Gift Cards].[Record #])=1174 Or ([Gift
Cards].[Record #])=1180 Or ([Gift Cards].[Record #])=1183 Or ([Gift
Cards].[Record #])=1179 Or ([Gift Cards].[Record #])=1181 Or ([Gift
Cards].[Record #])=353 Or ([Gift Cards].[Record #])=819 Or ([Gift
Cards].[Record #])=818 Or ([Gift Cards].[Record #])=1171 Or ([Gift
Cards].[Record #])=1173 Or ([Gift Cards].[Record #])=1172 Or ([Gift
Cards].[Record #])=690 Or ([Gift Cards].[Record #])=1210 Or ([Gift
Cards].[Record #])=1211 Or ([Gift Cards].[Record #])=1209 Or ([Gift
Cards].[Record #])=1121 Or ([Gift Cards].[Record #])=1002 Or ([Gift
Cards].[Record #])=966 Or ([Gift Cards].[Record #])=826 Or ([Gift
Cards].[Record #])=660 Or ([Gift Cards].[Record #])=661 Or ([Gift
Cards].[Record #])=943 Or ([Gift Cards].[Record #])=740 Or ([Gift
Cards].[Record #])=948 Or ([Gift Cards].[Record #])=542 Or ([Gift
Cards].[Record #])=1039 Or ([Gift Cards].[Record #])=699 Or ([Gift
Cards].[Record #])=1059 Or ([Gift Cards].[Record #])=1112 Or ([Gift
Cards].[Record #])=543 Or ([Gift Cards].[Record #])=713 Or ([Gift
Cards].[Record #])=1111 Or ([Gift Cards].[Record #])=1060 Or ([Gift
Cards].[Record #])=1113 Or ([Gift Cards].[Record #])=405 Or ([Gift
Cards].[Record #])=997 Or ([Gift Cards].[Record #])=504 Or ([Gift
Cards].[Record #])=1225 Or ([Gift Cards].[Record #])=1105 Or ([Gift
Cards].[Record #])=1107 Or ([Gift Cards].[Record #])=1106 Or ([Gift
Cards].[Record #])=958 Or ([Gift Cards].[Record #])=808 Or ([Gift
Cards].[Record #])=807 Or ([Gift Cards].[Record #])=1259 Or ([Gift
Cards].[Record #])=1119 Or ([Gift Cards].[Record #])=608 Or ([Gift
Cards].[Record #])=1055 Or ([Gift Cards].[Record #])=607 Or ([Gift
Cards].[Record #])=828 Or ([Gift Cards].[Record #])=824 Or ([Gift
Cards].[Record #])=1151 Or ([Gift Cards].[Record #])=1050 Or ([Gift
Cards].[Record #])=1287 Or ([Gift Cards].[Record #])=232 Or ([Gift
Cards].[Record #])=945 Or ([Gift Cards].[Record #])=1041 Or ([Gift
Cards].[Record #])=1040 Or ([Gift Cards].[Record #])=233 Or ([Gift
Cards].[Record #])=986 Or ([Gift Cards].[Record #])=927 Or ([Gift
Cards].[Record #])=830 Or ([Gift Cards].[Record #])=829 Or ([Gift
Cards].[Record #])=951 Or ([Gift Cards].[Record #])=950 Or ([Gift
Cards].[Record #])=894 Or ([Gift Cards].[Record #])=936 Or ([Gift
Cards].[Record #])=832 Or ([Gift Cards].[Record #])=1282 Or ([Gift
Cards].[Record #])=791 Or ([Gift Cards].[Record #])=792 Or ([Gift
Cards].[Record #])=793 Or ([Gift Cards].[Record #])=794 Or ([Gift
Cards].[Record #])=797 Or ([Gift Cards].[Record #])=235 Or ([Gift
Cards].[Record #])=1421 Or ([Gift Cards].[Record #])=1054 Or ([Gift
Cards].[Record #])=1212 Or ([Gift Cards].[Record #])=940 Or ([Gift
Cards].[Record #])=941 Or ([Gift Cards].[Record #])=1057 Or ([Gift
Cards].[Record #])=896 Or ([Gift Cards].[Record #])=416 Or ([Gift
Cards].[Record #])=912 Or ([Gift Cards].[Record #])=407 Or ([Gift
Cards].[Record #])=406 Or ([Gift Cards].[Record #])=408 Or ([Gift
Cards].[Record #])=886 Or ([Gift Cards].[Record #])=885))
There has got to be an easier way to accomplish this. I thought about
creating a new column in my table called TEMP and making it a Yes/No field
and checking the fields of the records I need and doing the query that way,
but this will not work because I need to save these queries.
Can anyone help?