Date functions in sql statements



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@

.



Relevant Pages

  • Biztalk Server 2004 - Database synchronization
    ... I have a requirement where in I need to synchronize my legacy Progress ... row to get inserted into my SQL Server table as well. ... various options to access this database from biztalk? ...
    (microsoft.public.biztalk.general)
  • Re: Biztalk Server 2004 - Database synchronization
    ... There are cases where these types of problems are well addressed by BizTalk ... > I have a requirement where in I need to synchronize my legacy Progress ... > database to SQL Server. ... > row to get inserted into my SQL Server table as well. ...
    (microsoft.public.biztalk.general)
  • RE: Progress ODBC Connection Problem
    ... trying to connect to a progress 9.1E db. ... I have the Datadirect drivers setup ... For testing I am creating a trivially simple query where I am selecting ... SQL Server Inport & Export Wizard ...
    (microsoft.public.sqlserver.odbc)
  • Re: Progress ODBC Connection Problem
    ... SELECT prod, cono, whse ... trying to connect to a progress 9.1E db. ... I have the Datadirect drivers ... SQL Server Inport & Export Wizard ...
    (microsoft.public.sqlserver.odbc)
  • Re: .NET Error message
    ... 1.Microsoft SQL Server Reporting services 2005 ... 2.Install Microsoft SQL Server 2005 SP1 ...
    (microsoft.public.sqlserver.setup)