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

Last 7 days 1

Status
Not open for further replies.

PetersWeb

Programmer
Apr 26, 2000
29
AU
I have a list which is added to every few days. The addition date is auto inserted into the database.

How can I list the new additions for the past 7 days? [sig]<p>Peter Toby<br><a href=mailto:webmaster@petertoby.com.au>webmaster@petertoby.com.au</a><br><a href= site is under construction but getting better![/sig]
 
What database are you using ?

If Oracle, you can do something like:

SELECT message
FROM message_table
WHERE addition_date >= (SYSDATE - 7);

Simon. [sig][/sig]
 
Peter,

How about this:

<cfquery name=&quot;getmyList&quot; datasource=&quot;mydb&quot;>
SELECT myList
FROM myTable
WHERE Date()-7<=addition_Date

</cfquery>

<cfoutput query=&quot;getmyList&quot;>
mylist #whatEverFieldYouWantToDisplay#
</cfoutput>

Hope this is what u r looking for
[sig]<p>GH<br>[/sig]
 
Thanks giahan,

That did the trick!

You're a genius!!

Thanks to SimonA for your help too.

[sig]<p>Peter Toby<br><a href=mailto:webmaster@petertoby.com.au>webmaster@petertoby.com.au</a><br><a href= site is under construction but getting better![/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top