Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


NEED HELP WITH SHOW DATABASE INFORMATION BY DATE

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,35515
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> NEED HELP WITH SHOW DATABASE INFORMATION BY DATE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 NEED HELP WITH SHOW DATABASE INFORMATION BY DATE - 6/18/2006 6:42:10 AM   
  sebbe

 

Posts: 2
Score: 0
Joined: 6/18/2006
Status: offline
Hi

I need help, please!

I uses access-database, with a tabel, 'tblClasses'.
And a colum called 'recordDateShow'.

What i need help with is something like this:

<%
   date1 = DateSerial(year(date), month(date), day(date))
   date2 = DateSerial(rsClasses.Fields.Item("ClassesDateShow").Value)
   if date1 >= date2 then
       response.write "Book now!"
   else
       response.write "Canīt book yet!"
   end if
%>

This is how it shuld work:

If lets say if todays date is higher or the same as 'recordDateShow' is, then write 'Book now!'.
But if 'recordDateShow' is higher then todays date, then write 'Canīt book yet!'.

The problem is I cant get it to work!

I not very good with this kind of scripts, could be complete wrong script for this?
Or maybe I need to change the settings in the database?

Best regards
Sebastian
 
 
Post #: 1
 
 RE: NEED HELP WITH SHOW DATABASE INFORMATION BY DATE - 6/18/2006 7:41:02 AM   
  ehvbs

 

Posts: 2063
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi sebbe,

if the type of recordDateShow is Date, then try

   date1 = Date
   date2 = rsClasses.Fields.Item("ClassesDateShow").Value
   if date1 >= date2 then

(Never call a volatile function like Date or Time more than once to set a single
value; DateSerial expects 3 params, the field value is a Date (I hope))

(in reply to sebbe)
 
 
Post #: 2
 
 RE: NEED HELP WITH SHOW DATABASE INFORMATION BY DATE - 6/18/2006 7:53:39 AM   
  sebbe

 

Posts: 2
Score: 0
Joined: 6/18/2006
Status: offline
Thank you

That did the trick, it did work

Thank you

(in reply to sebbe)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> NEED HELP WITH SHOW DATABASE INFORMATION BY DATE Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts