• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFIF today is between dates do this?

Participant ,
Jun 05, 2014 Jun 05, 2014

Copy link to clipboard

Copied

So here is the logic I have I just can t figure how to code

If the date is between 5/31/2014 after 3:00 PM  and 6/7/2014 up to 3:00PM 

<CFSET payweek =1>

If the date is between 6/7/2014 after 3:00 PM  and 6/14/2014 up to 3:00PM

<CFSET payweek =2>

If the date is between 6/14/2014 after 3:00 PM  and 6/21/2014 up to 3:00PM

<CFSET payweek =3>

I know I could code all of the weeks but isn't there a way to do this with a loop when you have know starting date 5/31/2014 and time and set length 7 days?

Views

436

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 05, 2014 Jun 05, 2014

Take your pick from these 2 alternatives:

<cfif theDate GTE createdatetime(2014,5,31,15,0,0) AND theDate LTE createdatetime(2014,6,7,14,59,59)>

    <CFSET payweek =1>

<cfelseif theDate GTE createdatetime(2014,6,7,15,0,0) AND theDate LTE createdatetime(2014,6,14,14,59,59)>

    <CFSET payweek =2>

<cfelseif theDate GTE createdatetime(2014,6,14,15,0,0) AND theDate LTE createdatetime(2014,6,21,14,59,59)>

    <CFSET payweek =3>

</cfif>

<cfif theDate GTE createdatetime(2014,5,31,15,0,1) AND theDate LTE created

...

Votes

Translate

Translate
Community Expert ,
Jun 05, 2014 Jun 05, 2014

Copy link to clipboard

Copied

LATEST

Take your pick from these 2 alternatives:

<cfif theDate GTE createdatetime(2014,5,31,15,0,0) AND theDate LTE createdatetime(2014,6,7,14,59,59)>

    <CFSET payweek =1>

<cfelseif theDate GTE createdatetime(2014,6,7,15,0,0) AND theDate LTE createdatetime(2014,6,14,14,59,59)>

    <CFSET payweek =2>

<cfelseif theDate GTE createdatetime(2014,6,14,15,0,0) AND theDate LTE createdatetime(2014,6,21,14,59,59)>

    <CFSET payweek =3>

</cfif>

<cfif theDate GTE createdatetime(2014,5,31,15,0,1) AND theDate LTE createdatetime(2014,6,7,15,0,0)>

    <CFSET payweek =1>

<cfelseif theDate GTE createdatetime(2014,6,7,15,0,1) AND theDate LTE createdatetime(2014,6,14,15,0,0)>

    <CFSET payweek =2>

<cfelseif theDate GTE createdatetime(2014,6,14,15,0,1) AND theDate LTE createdatetime(2014,6,21,15,0,0)>

    <CFSET payweek =3>

</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation