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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set variable to current date in stored procedure 2

Status
Not open for further replies.

hblabonte

Programmer
Oct 3, 2001
84
US
This may seem like a simple one. I've got a datetime variable that I'm declaring in a stored procedure. How do I set it to be the current date?

(
@today datetime=Now
)

This gives me a "syntax error converting datetime from a character string."

thanks in advance,
H. Barnes
 
I think the correct syntax would be 'getdate'

e.g.

@today datetime = getdate

Andy
 
try:

declare @today datetime
select @today = getdate()
select @today
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top