Ask a Question related to Dreamweaver AppDev, Design and Development.
-
woodywyatt #1
SQL error with 2 statements
Hi
Can anyone tell me whats wrong with this SQL statement below?
The first bit is supposed to only show records less than 1 year old (which
works fine on it's own) and the next a standard query for a search form
(also works fine on it's own).
I'm trying to put both statements together on one page but I keep getting
errors when I test the statement.
SELECT *
FROM upload
WHERE Date>DateAdd('yyyy',-1,Now()); WHERE area = 'varName' AND pax LIKE
'varName2' AND rooms LIKE 'varName3
woodywyatt Guest
-
If Statements????
guys i was wondering if anybody here could help me. I have a page done up with all dynamic text and attributes on it that come from a management... -
Syntax error in INSERT INTO and UPDATE statements
maybe this is a noob question and i've been stairing at my screen too long trying to find the error but I'm having problems using the Insert into... -
2 sql statements in one <cfquery>
hi. is it possible to do something like this? <cfquery datasource="chDev" name="test"> SELECT * FROM test WHERE id = #url.id# INSERT INTO test... -
If statements in PHP?
How do i get something to show only if the user is logged in? For example, "log out" should only show if the user is logged in and "log in" should... -
If/else statements - help.
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm... -
Julian Roberts #2
Re: SQL error with 2 statements
You've got WHERE in there twice
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
woodywyatt #3
Re: SQL error with 2 statements
Hi Jules
Excuse my ignorance but do I just leave it out? Something like -
SELECT *
FROM upload
WHERE Date>DateAdd('yyyy',-1,Now()); area = 'varName' AND pax LIKE
'varName2' AND rooms LIKE 'varName3
Thanks
Gary
"Julian Roberts" <newsg@charon.co.uk> wrote in message
news:d3b18d$fpj$1@forums.macromedia.com...> You've got WHERE in there twice
>
> --
> Jules
> [url]http://www.charon.co.uk/charoncart[/url]
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
woodywyatt Guest
-
Julian Roberts #4
Re: SQL error with 2 statements
You'd already got most of the logic sussed, you'd use AND. ie
SELECT *
FROM upload
WHERE Date>DateAdd('yyyy',-1,Now()) AND area = 'varName' AND pax LIKE
'varName2' AND rooms LIKE 'varName3
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
woodywyatt #5
Re: SQL error with 2 statements
Thanks for your hepl Julian
I found it worked the other way round with variable first -
SELECT *
FROM upload
WHERE area = 'varName' AND pax LIKE 'varName2' AND rooms LIKE 'varName3'AND
Date>DateAdd('yyyy',-1,Now())
Cheers
Gary
"Julian Roberts" <newsg@charon.co.uk> wrote in message
news:d3b3l2$if0$1@forums.macromedia.com...> You'd already got most of the logic sussed, you'd use AND. ie
>
> SELECT *
> FROM upload
> WHERE Date>DateAdd('yyyy',-1,Now()) AND area = 'varName' AND pax LIKE
> 'varName2' AND rooms LIKE 'varName3
>
>
> --
> Jules
> [url]http://www.charon.co.uk/charoncart[/url]
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
woodywyatt Guest



Reply With Quote

