Parameter query cluase error when used for a date.
I am also having a problem with Parameter queries.
I want to prompt for parameters 1x at the beginning of a script and then use these
parameters over and over again without being prompted.
DECLARE @from1 DATETIME, @to1 DATETIME; SELECT @from1 = ::from1 , @to1 = ::to1
-- wn_TabTitle Window 1
select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by
from advisors
where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1
and @to1
go
-- wn_TabTitle Window 2
select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by
from advisors
where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1
and @to1
go
I only get results for Window 1. Why am I not getting results for Window 2? I want
to be able to enter Parameters 1x and have them flow through my script.
Any help would be appreciated.
>More details:
>- using the WinSQL Oracle Wire Protocol driver (for Oracle DB)
>- Win XP PC, US regional settings (i.e. short date format MM/DD/YYYY)
>
>The database has a table PO with a date column ORDERDATE.
>In WinSQL I can enter:
>SELECT * FROM PO WHERE ORDERDATE > '04/01/2008'
>... and get results.
>
>But when I enter:
>SELECT * FROM PO WHERE ORDERDATE > ::date
>... and enter the same date as a DATETIME value in the paramet window, I get the
aforementioned
>error.
>
>It doesn't make sense. If anyone has any ideas ?
>- Jip
>
>
>>"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000,
>>Native
>Code:
0)"