Solved

Datetime Form + process.cfm

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove Index.php in Codeigniter 12 64
URL redirect 4 59
How to best troubleshoot slow internet connections via proxy server? 2 84
Redirect to HTTPS results in Infinite LOOP 4 121
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

825 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