Date functions in sql statements
- From: "M@" <mattcushing@xxxxxxxxx>
- Date: 22 Jun 2006 08:47:38 -0700
I am working for a company that uses both SQL server and Progress dbs.
The progress db's are for one of our apps that is going to be around
for a long time.
They want to use SQL Server Reporting Services to generate a whole
bunch of reports, and I have been asked to set up some kind of dump
from Progress to SQL Server on a monthly basis.
I'm using DTS to do it all, but I am finding a problem getting some
syntax to work.
I'd like to
select <column1>,<column2> etc
from pub.table
where column1 = X
where X is the sysdate, but I need to format it. The data in progress
is saved with a period which is just YEAR-1-MONTH. Why they use the
first of the month I am not sure, but that's the way it's laid out.
I'd like to somehow pull the month and year out of sysdate and concat
them
YEAR-1-MONTH
with the month being the month before so I guess it'd have to be
YEAR-1-(MONTH-1)
But I would have to take into consideration what happens in January as
well.
I saw some posts on ADD_MONTHS(MONTH, -1), but the sql statement didn't
like it.
Thanks!
M@
.
- Prev by Date: MFG/PRO Programmer Analyst position in North Carolina
- Next by Date: Progress Dynamic Queries Tool Kit Available - Download now!
- Previous by thread: MFG/PRO Programmer Analyst position in North Carolina
- Next by thread: Progress Dynamic Queries Tool Kit Available - Download now!
- Index(es):
Relevant Pages
|