Judith,

It looks like you are running through a Cold Fusion query called GetDates, and 
trying to update a table called tblPPSRetro.

The CFOUTPUT tag will run through a loop once for each record in the GetDates 
query.

The <cfquery> therefore will run once for each record in the GetDates query.

I think your issue is that the <cfquery> runs an update without specifying 
which record to update, so it is updateing EVERY record in the table with the 
current GETDATE value for each look in the CFOUTPUT tag.

Does this make sense?

You need to qualify your update query to only update the record which matches 
the current GetDates record.

Jerry

Jerry Johnson
Web Developer
Dolan Media Company

>>> [EMAIL PROTECTED] 12/16/04 11:34AM >>>
Greets,

Ok, so I have this generated report that has dates formatted as a number 
(yyyymmdd). Now, when I import this report (text file) into Access, it 
only sees it as a Number. Here's my problem. As you can imagine, this 
format is useless for doing date comparisons with other tables.

How do I convert this number into a useable date format?

I've tried various permutations of the following with little success:

<cfoutput query="GetDates">
<cfset mo = Mid(FromCert, 5 ,2)>
<cfset da = Right(FromCert, 2)>
<cfset yr = Left(FromCert, 4)>
<cfset startdate = DateFormat(CreateDate(yr,mo,da), "mm/dd/yyyy")>
    <cfquery name="update" datasource="PPSData">
       UPDATE tblPPSRetro
       SET EpisodeStart = <cfqueryparam cfsqltype="cf_sql_date"
             value="#startdate#">
     </cfquery>
</cfoutput>

If I do a straight cfoutput (without the update query) the results are 
as expected (results to the screen/web page) in that I get every date in 
the column. But as soon as I add the cfquery - it goes all wonky and 
repeats only one date all the way down (and not even the correct date).

Any and all help would be greatly appreciated.

Thanks,
Judith



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:531
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to