Solved

Datetime Form + process.cfm

Posted on 2003-10-23
4
201 Views
Last Modified: 2013-12-24
I have adopted a CF app running on CF 5.0 Pro ... I also have -0 experience with CFML ... but from what I gather that basics look relatively straight forward .. anyhow ... I would like to pass two dates (start date/time and end date/time) to a processing page but I am not sure where to start ... the process page already has the two variables set, and it executes correctly returning records for the last 24 hrs ... but I want to be able to say ... give me everything from Friday to Sunday ... or Sunday to Monday ... not just the last 24hrs .... any help? ideas?
0
Comment
Question by:af500
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Expert Comment

by:CFDevHead
ID: 9608361
Why don't you post the code for both pages.  So we can better assist you.
0
 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 125 total points
ID: 9608733
the 2 vaiables on the second page that set the start and end time probably look something like this

<cfset starttime=datadd(hours,-24,now())>
<cfset endtime=now()>

(could have the wrong syntax I been doing T-SQL all day)

You'll want to change the <cfset to <cfparam name="starttime" default=datadd(hours,-24,now())>
What <cfparam does is if the variable is defined it leaves it alone if it is not it sets the variable to a default value.

In the other form you will simply want to send the start and end time via a form or in the URL or if it is an including file just set the start and end times. Make sure the variables are named the same. If you need more details let us know! Hope I didn't confuse you at all.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9608838
change ur queries - i assume that shld do it ...

in ur query - u may have a where clause "where datefield < #dateadd('h',now(),-24)#

u'll need to change this to dates

like :

cfset date1 = #dateonfriday#
cfset date2 = #dateonsunday#

where datefield >= #date1# and datefield <= #date2#

let me know ...

K'Rgds
Anand
0
 
LVL 1

Expert Comment

by:kjuliff
ID: 9609554
Are you asking how to PASS the two dates or how to make the query?

Others have answered the latter. To pass the 2 dates add them as parameters to your URL
eg URL="processit.cfm?date1=#date#&date2=#date2#"
If in a form just have the dates as hidden fields.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What You Need to Know when Searching for a Webhost Provider
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question