Link to home
Start Free TrialLog in
Avatar of Lynn Thames
Lynn ThamesFlag for United States of America

asked on

How can I build a query to update records in sql server 2008 with the current date/time

I have a table with Task_ID, User_ID, StartTime, and EndTime

My app is writeen in VB6 and I use adodb to connect to the sql server.

I need an update query (that will be turned into a stored procedure)  that accepts a User_ID and then updates 'NOW' to the EndTime for every record for that User_ID that has 'null' in the EndTime.

I could also pass the current time to the query if needed.

But how would I go about writing the query and the stored procedure to accomplish this?
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lynn Thames

ASKER

Thanks!  This did exactly what I wanted.