Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Using the DateTime Control.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using the DateTime Control.

 Post Reply Post Reply Page  <12
Author
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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"
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2004 at 2:06pm
Works beautifully, thanks.
Respectfully,
David.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.