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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do not display expired dates!

Status
Not open for further replies.

NEL3644

Technical User
Sep 4, 2000
26
US

I want to be able to check for expired dates (any date before current date is considered expired) and then display the next 12 non-expired dates starting w/ the current date.
For example:

dates
------------
jan, 23 1996
Mar, 05 1996
Apr, 23 1996
jan, 23 2000
Mar, 05 2000
Sep, 20 2000 ---current date
Sep, 22 2000
Oct, 05 2000
Oct, 23 2000
Oct, 30 2000
Nov, 20 2000
Nov, 23 2000
jan, 23 2001
Mar, 05 2001
Apr, 23 2001
Aug, 23 2002
Mar, 05 2002 --12th date
Apr, 23 2002
jan, 23 2002
Mar, 05 2002
Apr, 23 2003
Aug, 23 2003

Thank you!


[sig][/sig]
 
I couldn't think of a way to meet both both of those requirments at the same time : (


No sweat in a two piece job...
Use:
.
.
Where Dbdate > #CreateODBCDate(now())#
.
.

Then make the output query a "Loop":

<cfloop query=&quot;QueryName&quot; startrow=&quot;1&quot; endrow=&quot;12&quot;>
.
put your 12 records here
.
</cfloop>
 

Thank you very much for your sugestion...Now, I have one more question regarding comparing the dates...The format w/ which I output my dates look like this:

Oct 03,2000

Now, I want to be able to compare w/ the now() from the system which has the following format:

{d '2000-10-03'} [sig][/sig]
 
Hi,

I had the same problem. What db u use? for date field, the better way (as I know), format it as a text field. When you input use mm/dd/yy. If u want to display as &quot;mmm dd, yy&quot;, you can use the format syntax as CF support. U can compare or do anything with mm/dd/yy. I solved my problem that took me almost a week.

[sig]<p>GH ((-:<br><a href=mailto:giahan@hotmail.com>giahan@hotmail.com</a><br>(-:[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top