Hi,
I am developing a database for Lease management system, I have a field expire date of Lease agreement in my database.
Now if expiry date is 07-December-2009
I need alert about it 3 months ago means today.
So how I can write SQL Query for this purpose.
thanks in advance...
ayesha789
7
Posting Pro in Training
Recommended Answers
Jump to PostI dont think you need to query a date 3 months ago, you need to find dates three months from now
strtotime() function
bogus brain dead almost code$dateone=strtotime(now +3 month); $datetwo=strtotime(now +4 month); $result=mysql_query('select * from table where expiry > %s and expiry < %s, …
Jump to PostI am a landlord too..
you need to find expiry dates that are three months FROM now, now is the only date that is known, so search the database relative to now
select records based on the expiry being NOW +3 MONTH
the code scrap (badly) illustrates one method, selecting …
Jump to PostI dont think you need to query a date 3 months ago, you need to find dates three months from now
strtotime() function
bogus brain dead almost code$dateone=strtotime(now +3 month); $datetwo=strtotime(now +4 month); $result=mysql_query('select * from table where expiry > %s and expiry < %s, $dateone $datetwo');
as …
Jump to Postin my table there are above 4000 records in expiry field.
and I want to show alerts 3 months before.the code sample shows one way to select those records
not the only way
probably not the most efficient way.
I cannot see the database structure, if the date is …
Jump to PostI put two dates, to select a month span, from +3 months to plus 4 months
conceivably that would, if run on the first day of September produce all leases expiring in the month of December,
I have some leases that expire on the 26th of the month for example
…
All 21 Replies
almostbob
866
Retired: passive income ROCKS
ayesha789
7
Posting Pro in Training
almostbob
866
Retired: passive income ROCKS
ayesha789
7
Posting Pro in Training
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
almostbob
866
Retired: passive income ROCKS
ayesha789
7
Posting Pro in Training
almostbob
866
Retired: passive income ROCKS
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
almostbob
866
Retired: passive income ROCKS
kvprajapati
1,826
Posting Genius
Team Colleague
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
kvprajapati
1,826
Posting Genius
Team Colleague
ayesha789
7
Posting Pro in Training
kvprajapati
1,826
Posting Genius
Team Colleague
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.