DB: MSSQL 2008
CF Version: 9
<cfquery name="rsData" datasource="#request.dsn#">
SELECT GETDATE() AS CurrentDateTime1
SELECT GETDATE() AS CurrentDateTime2
</cfquery>
<cfoutput query="rsData">
#rsData.CurrentDateTime1#
#rsData.CurrentDateTime2#
</cfoutput>
<cfdump var="#rsData#">
I would expect to be able to output #rsData.CurrentDateTime2# as this is written but I get a hard error:
Element CURRENTDATETIME2 is undefined in rsData
Any ideas as to why? Is there a CFAdmin setting that needs to be enabled? There are other areas of the code where this works just fine so I'm a bit perplexed. Any suggestions on where to look to resolve this would be appreciated.
** UPDATED BASED UPON LEIGH'S ANSWER MAKING ME GO BACK AND SEE MY TYPO ** This is just a dirty example of what I was ultimately trying to do and may not work.
declare @start DATETIME, @end DATETIME
set @start = (
select max(date) DTM
from TABLE)
SET @lowStart_Search = dateadd(year,-1,@highStart_Search)
SELECT COLUMN1, COLUMN2
WHERE column3 <= @start
AND column3 >= @end
SELECT getDate() AS date1, getDate() AS date2