Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2005, 02:20 PM
Authorized User
 
Join Date: Jun 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default retrieve from Access by Date

ok This is the query i use to get data between startDate and endDate including if the dates entered are both today, it should return the record from only today.
However it does not the record set is eof. I have tried with "BETWEEN #" & CDate(startDate) & "# AND #" & CDate(endDate) & "# " with the same result an empty record set. However Data is in there.... Now if e.g i specify between two years it works like a charm... what is wrong???


objCommand.CommandText = "SELECT * From DataHead WHERE " & strList & " > 0 AND Finish = true AND DateCompleted >= #" & CDate(startDate) & "# AND DateCompleted <= #" & CDate(endDate) & "# Order BY CaseOfficer "

... there is always more to learn...
__________________
... there is always more to learn...
 
Old May 3rd, 2005, 03:15 PM
Authorized User
 
Join Date: Jun 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok ... it kills me ... if i change the startDate let's say from 05/03/2004 and the endDate to 03/05/2006 it works great ... but even between 01/01/2005 and 12/31/2005 it does not pick the entry upi took the Cdate(startDate) out and put it before the SQL statement startDate = CDate(request.QueryString("start")) (same with endDate) an it still sucks ... sooooo frustrated

... there is always more to learn...
 
Old May 4th, 2005, 12:53 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default


May be you have a wrong system date format , not the loggedin user but aspnet process (I_user...). Also try using the month abrv(jan,feb,...) instead of numeric.
You could print the CommandText and test directly in a access query window(if you have done, Is the result comming ok)

Prashant







Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve date with format (M Y) form database php Mahmoud82 PHP How-To 2 November 30th, 2006 07:10 AM
How to retrieve sistem date?? MAKO C# 1 April 12th, 2006 12:59 PM
Retrieve Date/Time From Network Server wscheiman Access VBA 3 February 21st, 2006 08:56 AM
how to retrieve the current date from the calendar johnsonlim026 ASP.NET 1.0 and 1.1 Basics 1 July 8th, 2005 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.