Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 date conversion

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-24 : 07:18:53
vishnu submitted "wanted convertion of date from manual date to sqldate formate
ie to_char and to_date description and howto use"

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-06-24 : 07:24:11
This sounds like another Orable question to me...

In SQL Server you would use convert()
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-06-24 : 08:54:41
CAST ('Jan 20 2004' As DATETIME) ??
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-24 : 20:00:07
Just because I think this is kewl. It really doesn't have a lot of useful purposes.

SET NOCOUNT ON

DECLARE
@min INT,
@max INT,
@date DATETIME

SELECT
@min = 1,
@max = 131,
@date = GETDATE()

SELECT @date

WHILE @min <= @max
BEGIN

IF @min BETWEEN 15 AND 19
OR @min = 26
OR @min BETWEEN 27 AND 99
OR @min BETWEEN 115 AND 119
OR @min BETWEEN 122 AND 125
OR @min BETWEEN 127 AND 129
BEGIN
GOTO NEXT_LOOP
END

SELECT @min, CONVERT(VARCHAR,@date,@min)

NEXT_LOOP:

SELECT @min = @min + 1
END


MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -