All the "SQL Server" functions mentioned here are carryovers from
Sybase, and are fully T-SQL (Transact-SQL).
Progress offers a few equivalents, but not all.
T-SQL "getdate()" is equivalent to Progress "cur_date()".
T-SQL CONVERT() is a bit more complicated, but not necessary in your
statement, I think. Anyway, Progress has a function "TO_CHAR()" that
takes a date and a format string as arguments. I don't have my TSQL
references in front of me, so I don't remember what format "112" equates
to, but here's an example of TO_CHAR():
SELECT TO_CHAR( CUR_DATE(), 'MM/DD/YYYY' );
yields: "06/03/2005".
As far as T_SQL's ultra-useful "DATEADD()", Progress has only
"ADD_MONTHS()". There is no ADD_DAYS() or ADD_YEARS(), but in this
case, it looks like you're trying to add months anyway (or subtract).
It's a very simple syntax like "ADD_MONTHS( date, 6 )". And I'm only
guessing that Progress, like Sybase, doesn't puke when you pass a
negative value.
So without actually taking the time to test this stuff, I'd say the
PROGRESS equivalent of your original statement would be:
(( invoicedate >= ADD_MONTHS( CUR_DATE(), -3 ) AND
( invoicedate < CUR_DATE() ))
Again, I don't see the purpose of your CONVERT() function. And no
database engine is going to know how to do date comparisons on character
dates.
Post by Steve FoleyYEAR (D)
MONTH(D)
DAY(D)
DATE(X,Y,Z)
I have no idea what a dateadd function, or a convert function does. I'm
guseeing getdate() is current date.
What are you trying to accomplish?
Post by Dan(Invoicedate > = dateadd (m, -3, convert (char(6), getdate(), 112) + '01')
AND (Invoicedate < convert (char (6), getdate(), 112) + '01'))
TIA,
Dan