date formating question

date formating question

Post by Frank Phillip » Mon, 05 Feb 2001 05:54:15



Hi, can anybody tell me or point me to the correct bit of the help file for
this problem.

I have a time date field which include time, I want to group by the day in
Access I would have written format([date],"dd/mmm/yyyy"). Is  there an
equivalent in sql.

Cheers

Frank

 
 
 

date formating question

Post by BP Margoli » Mon, 05 Feb 2001 07:41:24


Frank,

Please always post which version of SQL Server you are using. The "help"
files differ for each release of SQL Server. Assuming you are using SQL
Server 2000, check out the section "CAST and CONVERT" in the SQL Server 2000
Books Online. It sounds as it you probably want style 103 ...

select convert (char(10), getdate( ), 103)

----------------------------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


Quote:> Hi, can anybody tell me or point me to the correct bit of the help file
for
> this problem.

> I have a time date field which include time, I want to group by the day in
> Access I would have written format([date],"dd/mmm/yyyy"). Is  there an
> equivalent in sql.

> Cheers

> Frank


 
 
 

1. Newbie question on date formating

I am a newbie to SQL 2000 (actually Databases as a whole)
and am building my fist database to track jobs here at
our office. I am wondering if this is where I should post
my questions.
Job number ( we at office create job numbers by year+
month + sequential number fo rthat year. ie if the first
job was sold on Jan 02, 2003 the job number is 0301-0001

and second job sold on feb 3rd would be 0302-0002

I have a table with
JobID - Int(4) key
JobID navchar (10)

In the formula for Job ID I have entered the following
(str(datepart(year,getdate())) + str(datepart
(month,getdate())) + '-' + str([TempTestID]))

The formatting is not correct.
Can anyone help?

I have created a table

2. Information on RAID disk arrays

3. Formating Dates

4. variables in a cursor - declaration

5. Selecting and Formating Dates

6. New to Sybase, need help with failover, etc

7. formating dates and strings

8. Urgent : How to move Sql Server and databases on an other drive

9. Date Formating Problem

10. Help Formating a date in sql

11. Formating Dates

12. formating dates