Print Page | Close Window

SQL Dates

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5421
Printed Date: 29 March 2026 at 2:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Dates
Posted By: group1
Subject: SQL Dates
Date Posted: 01 September 2003 at 8:39am
Hey everyone, i cannot issue this statement no matter how hard i try

SELECT 43-sum(Persons) as Total FROM Bookings WHERE Date < 01/01/2004

but if i do something like this, it works

SELECT 43-sum(Persons) as Total FROM Bookings WHERE Persons < 2


what am i doing wrong, i have put quotes, apostrophes, and everything around the date 01/01/2004 but it still returns nothing!

why is this???




Replies:
Posted By: Phat
Date Posted: 01 September 2003 at 9:15am

Try SELECT 43-sum(Persons) as Total FROM Bookings WHERE [Date] < #01/01/2004#



-------------
http://buildit.sitesell.com/sitebuildithome.html - Get a website that sells


Posted By: ljamal
Date Posted: 01 September 2003 at 11:20am
If you are using Access you need to surround the date with the number sign '#'

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net