Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2005, 04:36 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default Anyone expert in time function

Hello!

I'm having problem in displaying records by time.

Problem:
I want to display all records which are posted before 10:00:00 AM on 3rd March. The problem is, it is displaying all records posted before 10:00:00 PM on 3rd March.

Following is the part of query for time:

FORMAT(EXPIRE_TIME,'LONG TIME') < #"& time() &"#


Database is MS Access and time stored in database is in 24Hrs format.


Any idea..
Any help...

Will really be appriciated


Regards
Zeeshan Ahmed





Reply With Quote
  #2 (permalink)  
Old May 3rd, 2005, 06:28 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Print your sql statement at run time and post it (sounds like you could solve this by trial and error)

Wind is your friend
Matt
Reply With Quote
  #3 (permalink)  
Old May 3rd, 2005, 08:02 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

Following line was printed at run time:

FORMAT(WDS.EXPIRE_DATE,'SHORT DATE') <= #3/3/2005# AND FORMAT(WDS.EXPIRE_TIME,'LONG TIME') < #6:05:06 PM#

Reply With Quote
  #4 (permalink)  
Old May 3rd, 2005, 08:05 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

There isn't any problem of date. Is only the time. It seems it can't differ between "AM" and "PM"

Reply With Quote
  #5 (permalink)  
Old May 3rd, 2005, 08:11 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I was looking for the complete sql statement. What is WDS.EXPIRE_DATE? I have never seen this before - sorry I have not been much help.


Wind is your friend
Matt
Reply With Quote
  #6 (permalink)  
Old May 3rd, 2005, 09:36 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

Below is the sql query:

SELECT * FROM DOCUMENTS WHERE FORMAT(EXPIRE_DATE,'SHORT DATE') <= #3/3/2005# AND FORMAT(EXPIRE_TIME,'LONG TIME') < #6:05:06 PM#

Reply With Quote
  #7 (permalink)  
Old May 3rd, 2005, 10:38 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;I want to display all records which are posted before 10:00:00 AM on 3rd March.
Wouldnt the query above give you all records before 6:05:06 PM?

IMO Storing dates and times in the same field is a better practice. What is an exact example of the values held in the 'EXPIRE_DATE' and 'EXPIRE_TIME' fileds.

Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The expert programmers take a look ojbrowser Visual Studio 2005 0 August 12th, 2008 07:04 AM
Sql Query Expert! itHighway Classic ASP Basics 1 June 5th, 2005 11:00 PM
is there any expert who can help me surya221 Classic ASP Databases 1 March 24th, 2005 10:46 PM
XSLT expert required..thanks. sundar_revathi XSLT 1 December 13th, 2004 08:01 PM
Is there a Date() function that includes time? AviatorTim Classic ASP Basics 1 April 27th, 2004 03:10 AM



All times are GMT -4. The time now is 04:23 AM.


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