|
In few of the reports I came across this while doing some maintenance work... beautiful isn't it ???
select ......
where
and F2TRDT >= " & Year(Parameters!DateFrom.Value)*10000+Month(Parameters!DateFrom.Value)*100+day(Parameters!DateFrom.Value) & "
and F2TRDT <= " & Year(Parameters!DateTo.Value)*10000+Month(Parameters!DateTo.Value)*100+day(Parameters!DateTo.Value) & "
Zen and the art of software maintenance : rm -rf *
Math is like love : a simple idea but it can get complicated.
|
|
|
|
|
Oh, I see your point: that guy was assuming a month could have upto 99 days, and a year upto 99 months, and thus was waisting many numbers, and his formula will soon hit the limits of an Int32.
He'd better do a
and F2TRDT >= " & Year(Parameters!DateFrom.Value)*372+Month(Parameters!DateFrom.Value)*31+day(Parameters!DateFrom.Value) & "
and F2TRDT <= " & Year(Parameters!DateTo.Value)*372+Month(Parameters!DateTo.Value)*31+day(Parameters!DateTo.Value) & "
which still waists some 6 or 7 days per year.
|
|
|
|
|
It is not about converting into integer number... The date needs to be in yyyyMMdd format.. The whole point is why not use Foramt() function...
Zen and the art of software maintenance : rm -rf *
Math is like love : a simple idea but it can get complicated.
|
|
|
|
|
... I'd better have marked my post as a joke ...
|
|
|
|
|
virang_21 wrote: The whole point is why not use Foramt() function...
Is that similar to the Format() function?
|
|
|
|
|
now i need some mind bleach, thanks.
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|