Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Database Select by Date
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Database Select by Date

 Post Reply Post Reply Page  <123>
Author
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:10pm
put this

"&CDate(RsStrips("dato"))&"

in #

so #"&CDate(RsStrips("dato"))&"#

try that. it should select records greater than the set date. it shouldn't return any record before the set date.
Back to Top
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:23pm
Sorry to say, it still returns the wrong value.

I have a response.write here:

Select Date = 02-12-2004
Output Date = 01-12-2004

I'm just lost - because if i write a normal "IF "OUTPUT date" > "SelectDate" it will tell me that the Select Date is higher than the Output date... using the same strings etc... as i do in the sql string.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:26pm
try changing the > to < .. within the SQL.

you may need to change the ASC, but see what that does.. i think i had a simular problem with my tv guide application once...

Back to Top
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:29pm
Just tried it - it just resulted in the following:

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:33pm
right so its not finding records befind it.

i think i had to add 00:00:00 to the end of the values because they where date values and didn't use the time.. and then it may work .. add that to the CDated version (before CDate())

so CDate(rs.fieldname & " 00:00:00")

put that in the query
Back to Top
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:43pm
Tried it again - had no effect, it still makes the same result.

Here is my to query's

strSQL = "Select * from strips where ID = "&Request.querystring("id")&""
Set RsStrips = objconn.execute(strSQL)

strSQL = "Select Top 1 strips.* from strips where dato > #"&CDate(RsStrips("dato")&" 00:00:00")&"# Order By Dato ASC"
Set RsNext = objconn.execute(strSQL)

I still think it's funny -because i can make date(), now(), that filters, but not on a specific date.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:52pm
have you tried writing a date value within the query not using a command like Date() or NOW()

and see what that does.. im not sure why its not it should be.. have you tried >= that date? or does it have to be greater than the date stated?
Back to Top
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2005 at 6:56pm
I tried writing a date - and it just returns the same result, no matter which date i choose.
 
And i tried once with >= but no effect there either, and it has to be a greater date.
 
 
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.