Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only Date portion of GetDate()
Message
 
To
22/10/2012 12:31:03
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01555465
Message ID:
01555467
Views:
47
>I only need the date portion of GetDate() as I want to insert today's date into a table. What's the best way to do this?
>
>Thanks

Where you want to insert it?
What type is that field?

If the field is date type you don't need to do anything:
DECLARE @Test TABLE (fld Date)
INSERT INTO @Test VALUES (GETDATE())
SELECT * FROM @Test
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform