db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: Upcoming Birthdays Query for Derby database
Date Tue, 25 Nov 2008 23:33:35 GMT
"Sebas.Panikulam" <Sebas.Panikulam@wellsfargo.com> writes:

> Hi,
> If anybody tried writing a query for Derby to fetch the upcoming Birthdays.
> I am trying to modify the following query with respect to derby. The below
> one will find the B'Days in the next 7 days.
>
> SELECT * FROM [dbo].[tbl_EMPXYZ] 
> WHERE MONTH(DOB) BETWEEN MONTH(GETDATE()) AND
> MONTH(DATEADD(dd,20,GETDATE())) AND   
> DAY(DOB) BETWEEN DAY(GETDATE()) AND DAY(DATEADD(dd,7,GETDATE()))
>
> But I didn't find any function for adding date in derby(similar to DATEADD
> in the above query). 

This link shows some ideas:

http://www.mailinglistarchive.com/derby-user@db.apache.org/msg02879.html

You could also use stored functions:

http://db.apache.org/derby/docs/10.4/ref/rrefcreatefunctionstatement.html

Thanks,
Dag

Mime
View raw message