Solved

Datetime Form + process.cfm

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iis reverse proxy virtual directory 8 259
app server have enough resources... 2 64
IIS Authentication Error 401 16 63
Reverse Proxy problem 3 30
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

740 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