system
July 22, 2010, 7:07am
1
Hi,
We have universe which capture daily sales data.
So, I need to define the pre-defined condition in the universe to get previous day (only working day Monday - Friday) data. Can assist me what is the formula to use for this scenario?
Thanks,
PNB
pnb11281 (BOB member since 2010-07-06)
system
July 22, 2010, 7:43am
2
Database?
It’s a common question - have you searched for an answer?
Post the code that you have already tried and we can see what’s wrong.
dessa (BOB member since 2004-01-29)
system
July 22, 2010, 8:52am
3
Hi,
This sticky topic can get you started:
As per this topic on Oracle relative dates, here’s the same set of dates in SQL Server.
Please note that some may not work on SQL Server 2000, but all definitely work in 2005/8.
Yesterday
cast(convert(char(10),dateadd(d,-1,getdate()),23) as datetime)
Today
cast(convert(char(10),getdate(),23) as datetime)
The following also works for today:
dateadd(dd, datediff(dd,0,getdate()), 0)
Start of Current Month
cast(convert(char(7),getdate(),23)+'-01' as datetime)
End of Current Month
dateadd(d,-1…
Marek Chladny (BOB member since 2003-11-27)