Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Marking a date stamp and also a field as yes or no

Author  Topic 

dougancil
Posting Yak Master

217 Posts

Posted - 2011-01-20 : 15:07:41
I have the following query:

SELECT DISTINCT
[ScratchPad5].EmployeeNumber,
SUM( case when [sumhours]>40
THEN 40
ELSE [sumhours]
END ) AS TotalRegHours,
SUM( case when [sumhours]>40
THEN [sumhours]-40
ELSE 0
END ) AS TotalOT

FROM
ScratchPad5
GROUP BY
[ScratchPad5].EmployeeNumber,
sumhours

what I want to do is when this is ran, to create a timestamp for the field payrolldate and also mark a field payrollran as yes and to mark a field called approved as yes as well. Can someone please assist?

Thank you

dougancil
Posting Yak Master

217 Posts

Posted - 2011-01-21 : 11:36:56
I should also state that this is part of a stored procedure so if I can append this with a seperate query that would be ok too.
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-01-27 : 05:14:55
you can run the update statement just after the above one ...

Update TableName

set payrolldate =getdate()
payrollran ='Yes/No'

Where Conditions
Go to Top of Page
   

- Advertisement -