Number vs Text in sql query

MBruns

New member
Local time
Today, 05:45
Joined
Feb 6, 2004
Messages
8
I have a search form that I built for a contacts db which allows searching based on the user choosing which field to search, a boolean term and the data. Users can string together up to 3 fields connected by and/or. The whole thing works great for text and I was/am delighted with its' use in that context.

I've lifted and adapted that whole piece to another database which is a donor tracking system. In this system, some of the info is text and some of the info is numbers/dates. I've attempted to test for numbers and then convert them to integers prior to being passed to the where clause of the sql string, but it doesn't work. I sometimes get the mismatched data type error when using dates and with numbers, it simply doesn't work. I get the standard text for numbers issues where 50 is larger than 100 because 5 is larger than 1 and that's how text reads.

Any ideas about how to force numbers to be compared as numbers and text as text within an sql string? Thanks in advance for any advice you might have.

Mike
 
Mike,

Delimiters ...

If Number = 999 <-- Numbers
If String = 'string' <-- Strings
If Date = #Date# <-- Dates

Wayne
 

Users who are viewing this thread

Back
Top Bottom