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

Database Date

Status
Not open for further replies.

IWIT

Vendor
Mar 5, 2004
13
0
0
GB
I have made a dynamic web site that displays exhibitions from a database file. I want to make the exhibitions disappear after the data they take place on has passed. I think that the way that I need to do this is by using the datecompare function and then comparing it to the current date. However I am unsure how to go about this. I have looked at the function pages on Macromedias site but am a bit lost. I am a bit of a beginner at these things so any help would be much appreciated.
 
do you want to make them disappear by deleting them from the table?

or do you want to make them disappear by not selecting them?

in both cases it's better to do the date comparison in sql, not coldfusion

which database are you running?

what are the column and table names involved?

rudy
SQL Consulting
 
I am wishing to just have them disappear from the web page. I still want to keep them in the table.

The table name that I am using is called exhibition and the field names are show_id, name, city, dates, show_ends, hall, stand.

The field show_ends hold the date that the show ends on. Once this date has passed I would like this show to drop off of the website so that the only events showing on the webpage are the shows which are either running or in the future.
 
Code:
select show_id
     , name
     , city
     , dates
     , show_ends
     , hall
     , stand
  from exhibition
 where show_ends
    <= current_date
current_date is the standard sql function

replace with whatever the equivalent is in your database

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top