Link to home
Start Free TrialLog in
Avatar of LeadCo
LeadCo

asked on

How do you create dates for today, this week,this month and this year in cf8.

How do you create dates for today, this week,this month and this year in cf8.

My code:
Experts :
I have a variable called leadframe being passed via cfdiv bind from form element leadframe.
the options are: today, thisweek,thismonth,thisyear
I understand how to set the variables i just don't know how to calculate the values.
I want to set startdate to the calendar date to begin query and enddate to end query.



<cfif leadframe EQ "today">
    <cfset startdate = "">
    <cfset enddate = "">
<cfelseif leadframe EQ "thisWeek">
      <cfset startdate = "">
       <cfset enddate = "">
<cfelseif startdate EQ "ThisMonth">
   <cfset startdate = "">
   <cfset enddate = "">
<cfelseif leadframe EQ "ThisYear">
     <cfset startdate = "">
     <cfset enddate = "">
</cfif>
 
Query:
 
Select * from mytable where date between startdate and enddate

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SRIKANTH MADISHETTI
SRIKANTH MADISHETTI
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeadCo
LeadCo

ASKER

Thanks!