Click here to Skip to main content
15,939,960 members
Home / Discussions / Database
   

Database

 
AnswerRe: Calculate last week working days Pin
dan!sh 14-Jul-08 19:01
professional dan!sh 14-Jul-08 19:01 
AnswerRe: Calculate last week working days Pin
tsaunders15-Jul-08 14:19
tsaunders15-Jul-08 14:19 
AnswerRe: Calculate last week working days Pin
tsaunders15-Jul-08 14:34
tsaunders15-Jul-08 14:34 
QuestionSQL Server 2000 Desktop Edition Deployment issue. Pin
rajawaqas14-Jul-08 17:35
rajawaqas14-Jul-08 17:35 
QuestionHow to Grouped Data weekly monthly and Quarterly Pin
Rameez Raja14-Jul-08 16:59
Rameez Raja14-Jul-08 16:59 
AnswerRe: How to Grouped Data weekly monthly and Quarterly Pin
Mycroft Holmes14-Jul-08 18:07
professionalMycroft Holmes14-Jul-08 18:07 
GeneralRe: How to Grouped Data weekly monthly and Quarterly Pin
Rameez Raja14-Jul-08 23:56
Rameez Raja14-Jul-08 23:56 
GeneralRe: How to Grouped Data weekly monthly and Quarterly Pin
Mycroft Holmes15-Jul-08 0:10
professionalMycroft Holmes15-Jul-08 0:10 
Create another column name DateT as a datetime field
Convert your existing date data into the DateT field
When storing date data only store the date (today) unless you need the time component (now).

If you store the time component then you cannot select on '2008-Jul-15' as the actual value may be '2008-Jul-15 04:23:11' with the time component. This will force you to use between or format whenever you use the DateT field.

Try this
SELECT TOP 100
DateT
DATEPART(d,datadate) [Day],
DATEPART(wk,datadate) [wk],
DATEPART(mm,datadate) [mth],
DATENAME(weekday,datadate)
FROM Tablename


Never underestimate the power of human stupidity
RAH

AnswerRe: How to Group Data weekly monthly and Quarterly Pin
leoinfo15-Jul-08 4:33
leoinfo15-Jul-08 4:33 
QuestionHow to set the timer for SSIS package Pin
nagveni14-Jul-08 12:39
nagveni14-Jul-08 12:39 
AnswerRe: How to set the timer for SSIS package Pin
Marek Grzenkowicz15-Jul-08 22:58
Marek Grzenkowicz15-Jul-08 22:58 
GeneralRe: How to set the timer for SSIS package Pin
nagveni16-Jul-08 10:05
nagveni16-Jul-08 10:05 
GeneralRe: How to set the timer for SSIS package Pin
Marek Grzenkowicz19-Jul-08 9:50
Marek Grzenkowicz19-Jul-08 9:50 
Questionconvert datetime format Pin
tai-fun14-Jul-08 11:01
tai-fun14-Jul-08 11:01 
AnswerRe: convert datetime format Pin
Arindam Tewary14-Jul-08 22:09
professionalArindam Tewary14-Jul-08 22:09 
GeneralRe: convert datetime format Pin
tai-fun15-Jul-08 1:15
tai-fun15-Jul-08 1:15 
AnswerRe: convert datetime format Pin
leoinfo15-Jul-08 5:35
leoinfo15-Jul-08 5:35 
QuestionBULK INSERT and collation problem Pin
msx2314-Jul-08 10:56
msx2314-Jul-08 10:56 
AnswerRe: BULK INSERT and collation problem Pin
Syed Mehroz Alam15-Jul-08 1:08
Syed Mehroz Alam15-Jul-08 1:08 
QuestionWhere To Buy SQL 2000 Reporting Service? [modified] Pin
thundernow14-Jul-08 4:21
thundernow14-Jul-08 4:21 
AnswerRe: Where To Buy SQL 2000 Reporting Service? Pin
DerekFL14-Jul-08 7:51
DerekFL14-Jul-08 7:51 
QuestionFind Last week dates? Pin
Member 387988114-Jul-08 3:04
Member 387988114-Jul-08 3:04 
AnswerRe: Find Last week dates? Pin
subai14-Jul-08 3:21
subai14-Jul-08 3:21 
AnswerRe: Find Last week dates? Pin
leoinfo14-Jul-08 3:35
leoinfo14-Jul-08 3:35 
AnswerRe: Find Last week dates? Pin
TheFM23414-Jul-08 6:26
TheFM23414-Jul-08 6:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.