I have this query at the very top of my cfm file. It's right under the <body> tag. The date list which is returned from the query below isn't sorted in DESC order when the page first loads, but it does when you refresh the page. Why does this happen?
I'm sorry for these questions, but I don't know where else to ask really.
[code=cfm]
<cfquery name="getEDV2_d t" datasource="Cod eGreyDW" dbtype="ODBC">
SELECT tbledv2.date,tb ledv2.time from tbledv2
UNION SELECT tbl3c.date,tbl3 c.time from tbl3C
UNION SELECT tbl4.date,tbl4. time from tbl4
UNION SELECT tblcodegreydiv. date,tblcodegre ydiv.time from tblcodegreydiv
UNION SELECT tblfosterwing.d ate,tblfosterwi ng.time from tblfosterwing
UNION SELECT tblicu.date,tbl icu.time from tblicu
UNION SELECT tblmedsurg.date ,tblmedsurg.tim e from tblmedsurg
ORDER by date DESC,time DESC
</cfquery>
<form method="post" action="BigPic_ dt_v2.cfm?refDT =123">
</cfoutput>
<SELECT name="ed_dt">
<option>Selec t a Date/Time</option>
<cfoutput query="getEDV2_ dt">
<cfset ed_date=#DateFo rmat(date,"mm-dd-yy")#>
<cfset ed_time=#TimeFo rmat(time,"HH:m m")#>
<cfset DT=#ed_date# & ' ' & #ed_time#>
<option>#DT#</option>
<cfif isDefined("ed_d t")>
<cfset #PDT# = #ed_dt#>
</cfif>
</cfoutput>
</SELECT>
<cfoutput>
<cfif isDefined("ed_d t")>
<input type="hidden" name="refreshDT " value="#ed_dt#" >
</cfif>
</cfoutput>
<input type="submit" value="Refresh" >
<cfif isDefined("ed_d t")>
<cfset #CLIENT.ED_Date _Time# = #ed_dt#>
</cfif>
<cfoutput>PDT = #PDT#</cfoutput>
</form>
[/code]
I'm sorry for these questions, but I don't know where else to ask really.
[code=cfm]
<cfquery name="getEDV2_d t" datasource="Cod eGreyDW" dbtype="ODBC">
SELECT tbledv2.date,tb ledv2.time from tbledv2
UNION SELECT tbl3c.date,tbl3 c.time from tbl3C
UNION SELECT tbl4.date,tbl4. time from tbl4
UNION SELECT tblcodegreydiv. date,tblcodegre ydiv.time from tblcodegreydiv
UNION SELECT tblfosterwing.d ate,tblfosterwi ng.time from tblfosterwing
UNION SELECT tblicu.date,tbl icu.time from tblicu
UNION SELECT tblmedsurg.date ,tblmedsurg.tim e from tblmedsurg
ORDER by date DESC,time DESC
</cfquery>
<form method="post" action="BigPic_ dt_v2.cfm?refDT =123">
</cfoutput>
<SELECT name="ed_dt">
<option>Selec t a Date/Time</option>
<cfoutput query="getEDV2_ dt">
<cfset ed_date=#DateFo rmat(date,"mm-dd-yy")#>
<cfset ed_time=#TimeFo rmat(time,"HH:m m")#>
<cfset DT=#ed_date# & ' ' & #ed_time#>
<option>#DT#</option>
<cfif isDefined("ed_d t")>
<cfset #PDT# = #ed_dt#>
</cfif>
</cfoutput>
</SELECT>
<cfoutput>
<cfif isDefined("ed_d t")>
<input type="hidden" name="refreshDT " value="#ed_dt#" >
</cfif>
</cfoutput>
<input type="submit" value="Refresh" >
<cfif isDefined("ed_d t")>
<cfset #CLIENT.ED_Date _Time# = #ed_dt#>
</cfif>
<cfoutput>PDT = #PDT#</cfoutput>
</form>
[/code]
Comment