Try this...


<cfquery name="sales" datasource="forecasting"
SELECT period_name AS 'q1'
FROM adj_periods
WHERE period_id = 1
</cfquery>

Regards...

Declare is a keyword for MS SQL not  SQL language...i'm ok ?


__
MSc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer.
DIGI- Grupo de Desarrollo
COPEXTEL, S.A.

-----Original Message-----
From: Chris More [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 09:50 AM
To: CF-Talk
Subject: Declared SQL variables in select statement error

Why can I execute this statement fine in MS SQL Analyzer:

DECLARE @q1 varchar(7)

SELECT @q1 = period_name
FROM adj_periods
WHERE period_id = 1

And If I try to do this in CF:

<cfquery name="sales" datasource="forecasting"
DECLARE @q1 varchar(7)

SELECT @q1 = period_name
FROM adj_periods
WHERE period_id = 1
</cfquery>

I get this error:

QUERY The QUERY attribute of the tag does not specify the name of an
available query

This is a simplified version of my problem, but it seems that CF will
execute the query without an error but the returned query structure
won't exist at all.

Has anyone else ran into this problem?

Thanks,
Chris
[EMAIL PROTECTED]
  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to