User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 28 Oct 2003, 18:54   #1
Dante Hicks
Clerk
 
Join Date: Jun 2001
Posts: 13,940
Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Dumb ASP/SQL Query

OK, I am using ASP and MS Access to display some records.

I have the following lines in ASP which I am using to set up the sql query.

Code:
dim eff_date
eff_date = rs.Fields("eff_date")
dim letcode
letcode = rs.Fields("letcode")
dim bsize
bsize = rs.Fields("bsize")
dim pcode
pcode= rs.Fields("pcode")
dim points
points = rs.Fields("points")	
	 
sql2 = "SELECT * from property_list where pcode = '" & pcode & "' and letcode =  '" & letcode & "' and bsize  = '" & bsize & "' and eff_date > " & eff_date & " order by eff_date asc"
Now, if I have a look at the sql2 variable I've created it's as follows :

SELECT * from property_list where pcode = 'HSE' and letcode = 'EM1' and bsize = '3' and eff_date > 25/05/02 order by eff_date asc

(the numbers/values can be ignored - they're from elsewhere). Which is exactly what I want. However, when I come to run the SQL I get _ALL_ records, not just the ones after 25/05/02. WHY? The eff_date column in access is a datetime datatype, and the order by bit of the query works fine (i.e. Access realises it is a date, and is capable of putting it in date-order), so why is the SQL effectively ignoring my "eff_date > 25/05/02" bit? Do I have set up the datatype differently or something? Am I having a brain haemorage or would the above work in MySQL?
Dante Hicks is offline   Reply With Quote
Unread 28 Oct 2003, 19:13   #2
Mit
Let battle commence
 
Mit's Avatar
 
Join Date: Feb 2002
Location: England
Posts: 732
Mit is a jewel in the roughMit is a jewel in the roughMit is a jewel in the rough
Re: Dumb ASP/SQL Query

Can't just remember, but i've seen similar to that before, tried putting the date in "s ?
__________________
Mit
http://tim.igoe.me.uk - Development Blog
Whats on TV now - UK TV Guide

<Mendosa> mit is a cute cudlly toy that will be in the shops by christmas
<mig-work> ur now my eternal fav pa god
<Squiz> i name thee, Sir Mit
<Zeus> u my friend are a true gamer I knew u were
Mit is offline   Reply With Quote
Unread 28 Oct 2003, 19:15   #3
Dante Hicks
Clerk
 
Join Date: Jun 2001
Posts: 13,940
Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Dumb ASP/SQL Query

Quote:
Originally Posted by Mit
Can't just remember, but i've seen similar to that before, tried putting the date in "s ?
Yeah, but I just get :

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.
Dante Hicks is offline   Reply With Quote
Unread 28 Oct 2003, 20:46   #4
Caesar2
Commander
 
Caesar2's Avatar
 
Join Date: Sep 2001
Location: Netherlands
Posts: 146
Caesar2 is just really niceCaesar2 is just really niceCaesar2 is just really niceCaesar2 is just really nice
Re: Dumb ASP/SQL Query

Quote:
Originally Posted by Dante Hicks
Code:
... eff_date > " & eff_date & " order by eff_date asc"
should be:

... eff_date > #" & eff_date & "# order by eff_date asc"
__________________
Quote:
Originally posted by Cochese
Cathaar are not overpowered.

You were just "bashed", live with it.
Caesar2 is offline   Reply With Quote
Unread 29 Oct 2003, 10:17   #5
Dante Hicks
Clerk
 
Join Date: Jun 2001
Posts: 13,940
Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Dumb ASP/SQL Query

Quote:
Originally Posted by Caesar2
should be:

... eff_date > #" & eff_date & "# order by eff_date asc"
\o/

You rock, etc.

Ta.
Dante Hicks is offline   Reply With Quote
Unread 29 Oct 2003, 17:52   #6
Caesar2
Commander
 
Caesar2's Avatar
 
Join Date: Sep 2001
Location: Netherlands
Posts: 146
Caesar2 is just really niceCaesar2 is just really niceCaesar2 is just really niceCaesar2 is just really nice
Re: Dumb ASP/SQL Query

no problem

it's one of the abnormalities in access like using:

WHERE columnname LIKE "*...*"

instead of

WHERE columnname LIKE '%...%'
__________________
Quote:
Originally posted by Cochese
Cathaar are not overpowered.

You were just "bashed", live with it.
Caesar2 is offline   Reply With Quote
Reply



Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Johnny Depp Likens U.S. to 'Dumb Puppy' Zar General Discussions 19 4 Sep 2003 16:10
Append Query in Access 2002 Minty Programming and Discussion 6 1 Jul 2003 20:43
[1] Case & [2] Back-up Fan query Androme Hardware and Tech Support 24 28 Jan 2003 18:14
ATX power supply query cookiemay Hardware and Tech Support 8 23 Jan 2003 00:27
A query: *Bump* Ragnarak General Discussions 4 11 Jan 2003 22:07


All times are GMT +1. The time now is 07:18.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018