Wrox Programmer Forums
|
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 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 June 2nd, 2004, 01:16 AM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default Comparing Dates Issue

He everyone,

I am having a problem with a search facility that will display records from a search option. a section of the search criteria is Date From - Date To

I have set these up as select boxes for dayfrom, monthfrom, yearfrom and the same for the dayto, monthto, yearto

Once the form is submitted i merge into DateTo & DateFrom variables.

Now i have 2 compariable days which will be valid.

I then use them is a betwen sql statement

Opp.OppPublished BETWEEN #"&DateFrom&"# AND #"&DateTo&"#

The only problem is that if they pick a day eg 31/4/2004

it crashes my sql statement because april has only got 30 days. But i need the 31 there for other months.

How can i round down the day to a valid day for the month without lengthy control structures?

Thanks

Tim

TDA
__________________
TDA
 
Old June 2nd, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Tim,

You may want to change to popup calanders or datepickers using javascript to solve this. Else you would have to check for a condition if Month is so and so and based on that you should populate the Days select list.

You can take a look at these scripts. Easy to copy paste and intergrate with your application.

Date Selector - Should be the right one in your case.

Date picker

You can also search for date pickers, you would get a lot of such stuff over the net.

Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 2nd, 2004, 06:30 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Thanks,

Works perfectly.


TIM :D

TDA





Similar Threads
Thread Thread Starter Forum Replies Last Post
comparing dates help. warhero XSLT 1 July 5th, 2007 09:41 AM
Comparing dates Tomi XSLT 1 September 21st, 2006 04:45 AM
Comparing Dates in XSLT kwilliams XSLT 7 December 1st, 2005 08:49 PM
Comparing Dates bennybee JSP Basics 1 April 3rd, 2005 09:31 PM
Help comparing dates Dave Brown Beginning PHP 3 December 20th, 2004 04:03 PM





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