Click here to Skip to main content
15,890,947 members
Home / Discussions / Database
   

Database

 
QuestionIs it possible to pass datepart abbreviations to a function? Pin
fd975019-Apr-11 23:16
professionalfd975019-Apr-11 23:16 
AnswerRe: Is it possible to pass datepart abbreviations to a function? Pin
J4amieC20-Apr-11 0:59
J4amieC20-Apr-11 0:59 
AnswerRe: Is it possible to pass datepart abbreviations to a function? Pin
fd975020-Apr-11 1:31
professionalfd975020-Apr-11 1:31 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
Mycroft Holmes20-Apr-11 12:55
professionalMycroft Holmes20-Apr-11 12:55 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
J4amieC20-Apr-11 21:49
J4amieC20-Apr-11 21:49 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
Mycroft Holmes20-Apr-11 22:08
professionalMycroft Holmes20-Apr-11 22:08 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
J4amieC20-Apr-11 22:14
J4amieC20-Apr-11 22:14 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
J4amieC20-Apr-11 22:17
J4amieC20-Apr-11 22:17 
Filip Dossche wrote:
but I wanted to do it with less code if it was possible


Just to be clear (it wasn;t explicit from my original post), that I had shown the code for a User Defined Function (UDF), and therefore this code would be written once, and not repeated every time you needed this logic.

Thereafter, the usage would be as simple as

SELECT * FROM Whatever WHERE date>dbo.FloorDate('DD',GetDate())


or perhaps

INSERT INTO somewhere (someInfo,someDate) VALUES ('abc',dbo.FloorDate('DD',GetDate()))

AnswerRe: Is it possible to pass datepart abbreviations to a function? Pin
PIEBALDconsult20-Apr-11 3:02
mvePIEBALDconsult20-Apr-11 3:02 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
J4amieC20-Apr-11 3:18
J4amieC20-Apr-11 3:18 
GeneralRe: Is it possible to pass datepart abbreviations to a function? Pin
PIEBALDconsult20-Apr-11 14:50
mvePIEBALDconsult20-Apr-11 14:50 
AnswerRe: Is it possible to pass datepart abbreviations to a function? Pin
jschell20-Apr-11 8:08
jschell20-Apr-11 8:08 
QuestionUsing the same table more than once in a SQL View Pin
Etienne_12319-Apr-11 20:53
Etienne_12319-Apr-11 20:53 
AnswerRe: Using the same table more than once in a SQL View Pin
loveangel88819-Apr-11 21:13
loveangel88819-Apr-11 21:13 
AnswerRe: Using the same table more than once in a SQL View Pin
Wayne Gaylard19-Apr-11 21:20
professionalWayne Gaylard19-Apr-11 21:20 
GeneralRe: Using the same table more than once in a SQL View [modified] Pin
Etienne_12319-Apr-11 23:37
Etienne_12319-Apr-11 23:37 
AnswerRe: Using the same table more than once in a SQL View Pin
Mycroft Holmes20-Apr-11 12:52
professionalMycroft Holmes20-Apr-11 12:52 
QuestionCan't update table with expression field Pin
Muammar©19-Apr-11 7:48
Muammar©19-Apr-11 7:48 
AnswerRe: Can't update table with expression field Pin
Luc Pattyn19-Apr-11 7:55
sitebuilderLuc Pattyn19-Apr-11 7:55 
GeneralRe: Can't update table with expression field Pin
Muammar©19-Apr-11 20:26
Muammar©19-Apr-11 20:26 
AnswerRe: Can't update table with expression field Pin
Mycroft Holmes19-Apr-11 12:51
professionalMycroft Holmes19-Apr-11 12:51 
GeneralRe: Can't update table with expression field Pin
Muammar©19-Apr-11 20:43
Muammar©19-Apr-11 20:43 
QuestionDelete query stuck in suspended status Pin
wizardzz19-Apr-11 6:21
wizardzz19-Apr-11 6:21 
AnswerRe: Delete query stuck in suspended status Pin
wizardzz19-Apr-11 6:36
wizardzz19-Apr-11 6:36 
JokeRe: Delete query stuck in suspended status Pin
Chris Meech19-Apr-11 8:17
Chris Meech19-Apr-11 8:17 

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.