Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help passing database name to crystal report

Status
Not open for further replies.

MzKitty

Programmer
Oct 28, 2003
254
US
I am using Impromptu 7.0. I am trying to select employees from a date range filter. The employee's anniversary needs to be >= today and <= 90 Days in the Future. I've displayed my 90 Days in the Future date and it is showing 02/23/2006, but I'm not picking up any employees with anniversary dates > 12/31/2005. Is this an issue with Impromptu?
Cathy
 
Sorry my subject line is wrong. This is about a date range problem in Impromptu.

Cathy
 
Can you copy your filter syntax from Impromptu and post it?
Also, can you copy the generated SQL and post?

Bill
 
Here's a copy of my filter and my sql:
Filter-
Anniversary Date >= (Now) and Anniversary Date <= 90 Days in Future
(01/04/2006 >= 11/23/2005) and (01/04/2006 <= 02/23/2006)

SQL-

select convert(datetime,convert(varchar,(datepart(year,getdate()) * 10000 + datepart(month,T1."EecDateOfLastHire") * 100) + datepart(day,T1."EecDateOfLastHire"))), (case when (datepart(month,getdate()) < 10) then datepart(year,getdate()) else (datepart(year,getdate()) + 1) end * 10000 + case when (datepart(month,getdate()) < 10) then (datepart(month,getdate()) + 3) when (datepart(month,getdate()) = 10) then 1 when (datepart(month,getdate()) = 11) then 2 else 3 end * 100) + datepart(day,getdate()), T1."EecOrgLvl4", T1."EecEmpNo", T1."EecDateOfLastHire", case when datepart(month,getdate()) < 10 then datepart(year,getdate()) else datepart(year,getdate()) + 1 end , case when datepart(month,getdate()) < 10 then datepart(month,getdate()) + 3 when datepart(month,getdate()) = 10 then 1 when datepart(month,getdate()) = 11 then 2 else 3 end
from "ULTIPRO_RIV"."dbo"."EmpComp" T1
where convert(datetime,convert(varchar,(datepart(year,getdate()) * 10000 + datepart(month,T1."EecDateOfLastHire") * 100) + datepart(day,T1."EecDateOfLastHire"))) >= getdate()

My filter is not picking up anyone with an Anniversary date greater than 12/31/2005.

Thanks
Cathy
 
I found it finally!!! The anniversary year was not set up correctly. I had made it equal to year(now) and if the date was less than today's date, it was not incrementing the year. Duh!!!! Thanks for your help Bill.

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top