|
| |
|
|
DaveKstl
Posts: 547 Joined: 4/21/2004 Status: offline
|
I need help with a Date Lookup Query - 1/25/2008 15:35:22
I have a Text Field in a form DateText In my Table I have 3 date fields: BegDate________EndDate_________PeriodDate 01/05/2008_____ 02/04/2008______02/01/2008 My challenge is the syntax for the query mySQL = "Select PeriodDate From Table Where Request.Form("DateText") Between BegDate AND EndDate" I realize that the SQL syntax is incorrect, I have tried several methods and get either Data mismatch or other errors. How do I convert a Text Field to be used in the above query? Thanks
|
|
|
|
DaveKstl
Posts: 547 Joined: 4/21/2004 Status: offline
|
RE: I need help with a Date Lookup Query - 1/25/2008 17:41:31
Not sure I understand but mySQL = "Select PeriodDate From Table Where Request.Form("DateText") Between BegDate AND EndDate" The customer enters the Request.Form("DateText") let's say 1/25/2008 as a text entry. The lookup then check for a value Between BegDate (beginning) AND EndDate (end). So the BegDate = 01/05/2008 and the EndDate in the table is 02/04/2008, 1/25/2008 falls between so I should get a return PeriodDate of 2/1/2008 Unfortunately, I am challenged with the Text Filed form the form being changed to a value value that works in the query.
|
|
|
|
DaveKstl
Posts: 547 Joined: 4/21/2004 Status: offline
|
RE: I need help with a Date Lookup Query - 1/28/2008 7:31:06
quote:
mySQL = "Select PeriodDate From Table Where #"&DtVar&"# Between BegDate AND EndDate" Thanks. I should know this, but I don't So a text field does not need to be converted before the data is placed in a query? It is the query that adjusts the data before it is written. So: Date is #&DteVar Number is '&NumVar&' Text is '"&TextVar&&"'
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|