| Author |
Topic Search Topic Options
|
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 07 July 2004 at 2:50pm |
Sorry, just re-read your code.
You just did your SQL Statement a little wrong, heres what it should be:
DBReadData.CommandText = "Select * from tblToday WHERE mDay = " & TodaysDay & " and mMonth = " & TodaysMonth
|
 |
davidshq
Senior Member
Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
|
Post Options
Thanks(0)
Quote Reply
Posted: 07 July 2004 at 2:53pm |
|
Looks great, can't test it now as I have to run to my other job....But I definetly appreciate the help and will post back whether it works or not later. Thanks again. Respectfully, David.
|
|
|
 |
davidshq
Senior Member
Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2004 at 11:19am |
|
Mart, Thanks for your help. That worked. One last question. Is it possible to tell it to do an ORDER BY mYear ASC? I tried adding that command in several different places in the SQL statement and nothing seems to work. I tried things like: SELECT * from tblToday ORDER BY mYear ASC WHERE... SELECT * from tblToday WHERE... ORDER BY mYear SELECT * from tblToday WHERE... AND ORDER BY mYear None of them worked. :-P I've done ORDER BY elsewhere, in the same format pretty much...but it just won't work here. Respectfully, David.
|
|
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2004 at 11:22am |
|
ORDER BY needs to be at the end of the query. Can you post in the full query and the error you get?
|
 |
davidshq
Senior Member
Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2004 at 11:43am |
This is the current code, without the ORDER BY statement. DBReadData.CommandText = "Select * from tblToday WHERE mDay=" & TodaysDay & " and mMonth=" & TodaysMonth Here is the code with ORDER BY: DBReadData.CommandText = "Select * from tblToday WHERE mDay=" & TodaysDay & " and mMonth=" & TodaysMonth & "ORDER BY mYear, mMonth, mDay ASC" The error message is as follows: Syntax error (missing operator) in query expression 'mDay=8 and mMonth=7ORDER BY mYear, mMonth, mDay ASC'. Respectfully, David.
|
|
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2004 at 12:15pm |
|
You have just missed a space, it should be:
DBReadData.CommandText = "Select * from tblToday WHERE mDay=" &
TodaysDay & " and mMonth=" & TodaysMonth & " ORDER BY mYear,
mMonth, mDay ASC"
|
 |
davidshq
Senior Member
Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 July 2004 at 2:06pm |
|
Works beautifully, thanks. Respectfully, David.
|
|
|
 |