Solved

Datetime Form + process.cfm

Posted on 2003-10-23
4
158 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now