Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Date Function for Obtaining Date from Server

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
If i have to get a date for a certain event, for exmple, when a user logins in, how do i get the date that the user logins and display the date on a User's Info page ? If there is a Date Updated field and the date changes upon an event being triggered, how should i write the code ?

THANX !
 

In SQL Server, you would use the getdate() function.

To display on a user page you would use Select.

Example: SELECT getdate() as CurrDate

To update a table you would Insert or Update a row.

Example: Insert table1 (col1, col2, col3) Values (val1, val2, getdate())

Example: Update table1 set col3=getdate() Where <criteria> ... Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top