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

Checks the complete date (mm/dd/yyyy) against another compelete date (mm/dd/yyyy)

Explorer ,
Dec 05, 2012 Dec 05, 2012

Copy link to clipboard

Copied

Hi,

Is there a cold fusion function that checks the complete date (mm/dd/yyyy) against another compelete date (mm/dd/yyyy)?

I have used the DateCompare but it only checks the month, day or year depending on the precision being used.

Thanks,

Mike

Views

608

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
LEGEND ,
Dec 06, 2012 Dec 06, 2012

Copy link to clipboard

Copied

What kind of check are you talking about?

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
Explorer ,
Dec 06, 2012 Dec 06, 2012

Copy link to clipboard

Copied

Check the complete date form a form against a complete date from a database table.

I would be check the date from the form against all the dates in the database table.

There would be two form dates, a start and end date. In the database there would be a start and end date.

The date check would ensure the entered start and end dates on the form do not overlap any of the start and end dates in the database.

I did notice the datecompare can be used without the precision option.

Mike

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
LEGEND ,
Dec 06, 2012 Dec 06, 2012

Copy link to clipboard

Copied

LATEST

Looks like you are trying to use coldfusion code when sql code would be more appropriate.

If I am interpreting your post correctly, you want to do somethign like this:

select some fields

from some tables

where #coldfusion start date# not between database_start_date and database_end_date

and more stuff to complete your logic

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
LEGEND ,
Dec 06, 2012 Dec 06, 2012

Copy link to clipboard

Copied

I think you might need to read the docs a bit more closely.  From the docs for dateCompare():

datePart

Optional. String. Precision of the comparison.

  • s Precise to the second (default)
  • n Precise to the minute
  • h Precise to the hour
  • d Precise to the day
  • m Precise to the month
  • yyyy Precise to the year

Indeed, even by default its behaviour is not what you suggest it is.

--

Adam

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