Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non-Date Parameter Query

Status
Not open for further replies.

dridge

IS-IT--Management
Mar 5, 2001
8
US
I am linked to a table with "INVDATE" not being a date/time field...it is a text 8 field. Can I still use a BETWEEN [Invdate] and [Invdate] parameter query? Is there a way to convert the text field so the parameter query works correctly...Any help would be greatly appreciated.
 
If the field is of the format yyyymmdd you can use between if you format your date the same way... otherwise <cringe> you will need to use the CDATE function on the field and put your date criteria under that. You may also need to use string manipulation functions to put the slashes in...

Where
Cdate((Left(invdate,2) & &quot;/&quot; & Mid(Invdate,3,2) & &quot;/&quot; & right(invdate,4)))
Between [Enter Start Date] and [Enter End Date]

The above where clause (check sql view) assumes a format of mmddyyyy
 
The Cdate function did not help me. Here is the SQL statement:
SELECT CDate([INVDATE]) AS Expr1
FROM DPL WHERE (((CDate([INVDATE])) Between [Enter Start Date] And [Enter End Date]))
WITH OWNERACCESS OPTION;

My INVDATE is in the format mm/dd/yy (with slashes already in there).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top