Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5970031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:18:57+00:00 2026-05-22T20:18:57+00:00

One of our databases has a page set up to print reports containing various

  • 0

One of our databases has a page set up to print reports containing various geological information. The database in question is a FoxPro DB, and contains a date field which in FoxPro is formatted mm/dd/yy.

There is a snippet of code in the report form

#LSDateFormat(qLithHead.drill_date, "mm/dd/yyyy")#

which is pulling the drill_date and converting it to the requested format, and in the process is taking all 1500~ records with no drill date and adding the default 12/30/1899 date.

Boss doesn’t want the default date in the reports, but wants the full, formatted date (when it exists) on the reports because they do have some data that goes back to the early 1900s and they need the full century listed.

I’m trying to write an if/else statement that will create a variable, d_date, and store

 LSDateFormat(qLithHead.drill_date, "mm/dd/yyyy")

if the field is filled,
else it will store an empty string ” ” if the date is empty.

<cfif (EMPTY(qLithHead.drill_date))>
     <cfset d_date=" ">
<cfelse>
     <cfset d_date=#LSDateFormat(qLithHead.drill_date, "mm/dd/yyyy")#>
</cfif>

and then in the date area of the report I’ll simply call the d_date variable, whatever its value:

#d_date#

In any case, that’s the general idea of what I’m trying to accomplish. I’m not at all sure of the CF syntax.

Any help you can offer is appreciated.

Thanks! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:18:58+00:00Added an answer on May 22, 2026 at 8:18 pm

    Coldfusion 9 has a isNull() function that returns a boolean:

    <cfif isNull(qLithHead.drill_date)> 
    

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSe9cbe5cf462523a0-3c4c0bb81223f1daffb-8000.html

    Or, if you are not running CF9, you could try:

    <cfif isDate(qLithHead.drill_date)>
    

    or

    <cfif Year(qLithHead.drill_date) EQ '1899'>
    

    to get rid of the ugly timestamp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After running exec sp_lock on one of our databases we found there's close to
Our database is currently at 64 Gb and one of our apps started to
I need to make a column unique in one of our database tables, and
At our company one of the core C++ classes (Database connection pointer) is implemented
One of our staff members has lost his mailbox but luckily has a dump
One of our MSI's has started failing with Error 2902. It'll get most of
Okay, so today I updated my database with new information from our 'live' database...
One of our clients has requested that we include the 'db_owner' role on the
I have two databases on one machine that also has two different sites running
My boss has a habit of performing queries on our databases that return tens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.