Skip to content
iywsdrdiyPublic

About

TSQL equivalent of the Oracle function

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

next_day

TSQL implementation of Oracle's next_day function.

Here you need only supply the first two letters of the week day, and it only uses English week day names.

To get the most recent Friday's date:

select dbo.next_day (dateadd(dd,-7,convert(date,getdate())),'Friday');

I don't know why Microsoft doesn't provide this function as standard. Unfortunately the Microsoft date manipulation is a lot more verbose than Oracle's too: select next_day(sysdate-7,'Friday') from dual is a lot easier to read.

About

TSQL equivalent of the Oracle function

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages