[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Using SYSDATE to search for prior Month & Year



Hello, I am new to SQRUG, but have been using MAXIMO for 4 years and SQR for 3 years.

In September of 1997 I wrote a report on SQLBase, using sysdate to find records broken down by month over a 6 month time frame based on a field "changedate". This program worked just fine going back a given number of months by coding these where statements within my select statements:

@month(changedate) = @month(sysdate) for current month

then another select statement read

@month(changedate) = (@month(sysdate)-1) for prior month

then and yet another select statement etc.

@month(changedate) = (@month(sysdate)-2) two month back etc.

But since the first of the year the report dose not report anything from prior year. ANY SUGGESTIONS?

also included in the select statements is

@year(changedate)=@year(sysdate) for current year and

@year(changedate)=(@year(sysdate)-1) for prior year.

Thank You

 

 

 

Larry McCown

Larry McCown

Northrop Grumman

One Hornet Way WE00/W9

El Segundo, CA. 90245

e-mail lmccown@world.northgrum.com

(310)332-8360 fax (310)331-7452

NP