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
 Transact-SQL (2000)
 Get the day name - please help

Author  Topic 

leahsmart
Posting Yak Master

133 Posts

Posted - 2003-11-11 : 07:31:59
Hi Reader,

I am currently sending data to Flash 2004 and need my date to be in a specific format for flash to except it in it's DateField component. I need to send a date with the format of 'Tue Nov 4 00:00:00 GMT+0000 2003' do you know how do do this?? How can I get the day name?

Any help would be great.

Leah

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2003-11-11 : 10:03:09
declare @date datetime

select @date = getdate()

select @date

select datename(dw,@date)

This gives the day name. You can use a left,3 and datepart function to format the entire date. Just wrap the entire thing in a function and you should be good to go.

MeanOldDBA
derrickleggett@hotmail.com

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

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2003-11-11 : 10:03:42
What this bit is suppose to mean :

'GMT+0000 2003'

My guess is you're sending the time-zone as well as the year?

__________________
Make love not war!
Go to Top of Page

leahsmart
Posting Yak Master

133 Posts

Posted - 2003-11-11 : 10:29:26
Thanks, that works great :)
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2003-11-11 : 10:30:48
GMT +0000 just means that it is the GMT with no variation. The getutcdate() function will give you this datetime.

MeanOldDBA
derrickleggett@hotmail.com

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

leahsmart
Posting Yak Master

133 Posts

Posted - 2003-11-11 : 10:32:17
Hummm, still does not work, what does this flash component want!!!!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-11-11 : 12:14:39
Have a look at CONVERT in SQL Server Books Online. Using that along with the DATEPART commands, you can build the required datetime format.

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-11 : 12:49:25
Flash scripting is based on JavaScript/ECMAScript, and that date format is the standard used by those languages. It is pretty aggravating to deal with, that's for sure.

You may want to consider passing the date as a string and converting it on the Flash side.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2003-11-11 : 15:39:54
Leah,

I wonder if it's expecting a comma string. There are some JS based components that need to have:

datepart(yy,@date) + ',' + datepart(mm,@date) + ',' + datepart(dd,@date)

This is kind of stupid, but worth a try.

MeanOldDBA
derrickleggett@hotmail.com

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

leahsmart
Posting Yak Master

133 Posts

Posted - 2003-11-12 : 04:28:58
Thanks for the help, have tried sending it as that before but it is no good. Maybe I should just stick to a good old text field :)
Go to Top of Page
   

- Advertisement -