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

Get Date from SQL Server 7.0

Status
Not open for further replies.

svagelis

Programmer
Joined
May 2, 2001
Messages
121
Location
GR
i m using the getdate function to get the current date from the server . I want to get only the date (not the time part etc). I used the following code. It works but i dont think thats the best way of doing this. Any help would be appreciated.
--------------------------------------------------------
Declare @MyDate as smalldatetime,
@MyDay as varchar(2),
@MyMonth as varchar(2),
@MyYear as varchar(4)

select @MyDate = GETDATE()

select @MyDay = CAST (DATEPART(day , @MyDate) as varchar(2))
select @MyMonth = CAST (DATEPART(month , @MyDate) as varchar(2))
select @MyYear = CAST ( DATEPART(yyyy , @MyDate) as varchar(4))
select @MyDate = CAST ((@MyMonth + '/' + @MyDay + '/' + @MyYear) as smalldatetime)
select @MyDate
 
try...

select convert(char(10), getdate(), 101)
 
I am using Analysis Services 2000 in SQL Server 2000, we pull the data from oracle to build the cubes. For the first time when we pull the data from oracle all the data is available in sql server but the second time i would like to refresh only the modified data from oracle to sql server. Any clues.......
 
GUXEBY,

Please post your question in a new thread. Your post is off the topic of this thread. Terry L. Broadbent - Salt Lake City, UT
Home of the 2002 Winter Olympics (Feb 8-24)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top