User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 15 Nov 2002, 13:49   #1
wu_trax
Guest
 
Posts: n/a
SQL-question: how do i get the current date

out of an MS-SQL-Server?
i did this a while ago with oracle by using some kind of 'dummy-table', but a) i forgot how and b) it wont work with sql-server anyway

i tryed to search the MS-homepage, but i didnt find anything useful :/
  Reply With Quote
Unread 15 Nov 2002, 13:53   #2
Bigchiefweale
Guest
 
Posts: n/a
SELECT CURRENT_TIMESTAMP
GO

?
  Reply With Quote
Unread 15 Nov 2002, 13:53   #3
wu_trax
Guest
 
Posts: n/a
that was fast and it works.
thank you
  Reply With Quote
Unread 15 Nov 2002, 15:30   #4
hinch
Banned
 
Join Date: May 2000
Location: Abducted By Aliens
Posts: 282
hinch is an unknown quantity at this point
what a **** way of doing it

set the default value for the field to (getdate())
hinch is offline   Reply With Quote
Unread 15 Nov 2002, 15:31   #5
Bigchiefweale
Guest
 
Posts: n/a
Quote:
Originally posted by hinchles
what a **** way of doing it

set the default value for the field to (getdate())
Bear in mind i know bugger all SQL as ive never had to use it nor have i done db's at uni and i was quite happy with ^^ :p
  Reply With Quote
Unread 15 Nov 2002, 15:34   #6
wu_trax
Guest
 
Posts: n/a
Quote:
Originally posted by Bigchiefweale


Bear in mind i know bugger all SQL as ive never had to use it nor have i done db's at uni and i was quite happy with ^^
that should make me worry about my education
  Reply With Quote
Unread 15 Nov 2002, 19:31   #7
mbushell
Registered User
 
mbushell's Avatar
 
Join Date: Jul 2000
Location: :noitacoL
Posts: 1,200
mbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus wouldmbushell spreads love and joy to the forum in the same way Jesus would
Re: SQL-question: how do i get the current date

Quote:
Originally posted by wu_trax
i tryed to search the MS-homepage, but i didnt find anything useful :/
I find drumming on a pigs belly whilst wearing rubber gloves, standing on my head with no trousers and letting my balls hang and eating mash potato as useful as the MS-homepage.
mbushell is offline   Reply With Quote
Unread 20 Nov 2002, 00:19   #8
Raging.Retard
Street Tramp
 
Raging.Retard's Avatar
 
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
Raging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant future
Re: Re: SQL-question: how do i get the current date

Quote:
Originally posted by mbushell


I find drumming on a pigs belly whilst wearing rubber gloves, standing on my head with no trousers and letting my balls hang and eating mash potato as useful as the MS-homepage.
Then clearly you should have just intalled the 'Books Online' that come with all legitimate versions of MSSQL. That reference pretty much contains everything.

Whats more, is that hinch is even nearly correct Though you dont need to set a default value to it like he said. GetDate() is a function that can be used anywhere its needed in a TSQL statment.

K thx.
__________________
Chimney Pots.
Raging.Retard is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 02:46.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018