|
| |
|
|
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.
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
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")
|
|
|
|
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.
|
|
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
|
|
|