SQL Server complains of an unfound column when using rs.update
Posted on 2004-11-12
Here's my problem...
I have a table with several fields
I want to mark the busiest hour for each combination of GroupName, Date.
So i open a recordset that groups by GroupName, Date and order it by the sum of (intValue1 + intValue2 + intValue3) as TotalCount descending.
Then i iterate through the recordset and every time i see a new groupname or date i set that busyHour to true (first one in a descending query is always the highest)
However, when i try to do a rs.update it tells me that the column TotalCount does not exist. Of course it doesn't exist its a calculated value!
The weirdest part however, is that up until 2 days ago...this code worked FINE...
Here's the code just in case
rs.Open "SELECT GroupName, BH, REGNIVIC + LOCREQIC + CSSIIVIC + RGCNIVOG + RTEREQOG + TRANIVIC AS IS41Count FROM pt_OMS_IS41 " & _
"WHERE OMTimestamp BETWEEN '" & Format(dteDate, "mm/dd/yyyy") & "' AND '" & Format(dteDate, "mm/dd/yyyy") & " 11:59:59 PM' " & _
"ORDER BY GroupName, REGNIVIC + LOCREQIC + CSSIIVIC + RGCNIVOG + RTEREQOG + TRANIVIC DESC"
While Not rs.EOF
If rs!GroupName <> i Then
rs!BH = "Y"
i = rs!GroupName
What's causing this?