navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

ASP Date Question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> ASP Date Question
Page: [1]
 
chadb

 

Posts: 485
From: Kansas
Status: offline

 
ASP Date Question - 2/4/2008 9:48:03   
I have 2 questions. I have a Access database, which has a table with a row called Date. I am trying to query using this:

Mydate = date()
str1 = "SELECT * FROM Birthdays where Date = " & MyDate

First questions is: This does not return anything, I have confirmed O do have a date match, second, What do I need to add to not show an error if there is not a match? I have tried this, but then it just tries to load the page and never finishes, or it takes a long time.

While Not MyRs.Eof

Thanks
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: ASP Date Question - 2/4/2008 10:46:15   
quote:

str1 = "SELECT * FROM Birthdays where Date = " & MyDate


Is the Date field a true Date/Time field? If SO, try this for Access DB:

str1 = "SELECT * FROM Birthdays where [Date] = #" & MyDate & "#"

and this for SQL server:

str1 = "SELECT * FROM Birthdays where [Date] = '" & MyDate & "'" (see the apostrophes?)

Se the [, ], #, and ' stuff? Time/Dates are delimited by # in Access and ' in many other SQL engines (MS SQL, mySQL, etc.)

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: ASP Date Question - 2/4/2008 10:50:00   
Yes, that is it. What should I do if it does not find a match? I want it to not give an error.

(in reply to rdouglass)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: ASP Date Question - 2/4/2008 13:31:22   
quote:

I want it to not give an error.


What kind of error and where in the code / what line # does it report?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: ASP Date Question - 2/4/2008 14:43:31   
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/Performance/defaultinwork.asp, line 29


Line 29 is:
bdname = MyRS("Name")

(in reply to rdouglass)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: ASP Date Question - 2/4/2008 15:35:26   
quote:

bdname = MyRS("Name")


Is that 'inside' the section that begins with this:

While Not MyRs.Eof

Does that make any sense? IOW, is it inside the section where we're sure we have a result as in "While Not MyRs.Eof "?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to chadb)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> ASP Date Question
Page: [1]
Jump to: 1





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