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 7818097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:27:43+00:00 2026-06-02T06:27:43+00:00

I have a Crystal report (version XI r3) that uses a SQL command object

  • 0

I have a Crystal report (version XI r3) that uses a SQL command object to retrieve its data. In the command object I have a parameter for a date. My database uses “date” fields stored as numeric values in YYYYMMDD format, so I’ve specified the parameter as numeric and added a prompt to say “enter date in YYYYMMDD format”.

My users don’t much care for that; they want to be able to use the date-picker and/or to be able to enter the date in MM/DD/YYYY format.

My investigations so far have led me to believe that if I convert the parameter to a true date datatype, I won’t be able to make use of it in the SQL command object because I can’t convert it from a date to a number in the SQL statement, so I’d have to do my date-range control in the Crystal Select Wizard rather than in my SQL statement, which could slow my report down by an order of magnitude or two (since I’m hitting a table that is indexed by this date field, and that has a lot of records per day).

Am I wrong? Is there a way to let a user enter a date in MM/DD/YYYY format and still be able to use it as a numeric YYYYMMDD parameter in my SQL command object?

  • 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-06-02T06:27:46+00:00Added an answer on June 2, 2026 at 6:27 am

    I’m afraid you would have to modify the original Command’s to replace the numeric parameter with a date parameter, and do the conversion from date to number within the Command itself.

    So, within the Command:

    WHERE MyDate = {?MyNumberParam)
    

    would become:

    WHERE MyDate = (YEAR({?MyDateParam})*10000) + (MONTH({?MyDateParam})*100) + DAY({?MyDateParam})
    

    The last part will convert 20th April 2012 to (2012*10000 + 4*100 + 20) = 20120420, which I believe is what you’d want.

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

Sidebar

Related Questions

I have a Crystal Report that looks like: Date | Person | Ticket |
I have a crystal report that shows sales volumes called week to date volume.
I have an application that uses the Crystal Report COM SDK to create and
Version: Crystal Report 2008 I have 2 parameters that prompt the user to enter
I have a crystal report that is like this: Group By Property.ID Group By
I have a crystal report that I have to add a Bar Code to.
I have a Crystal Report, that is populated with a stored procedure, it also
We have a legacy VB6 application that uses Crystal Reports XI to generate printed
We have an application that stores its database files in a subfolder of the
I have an app that uses both NHibernate and Crystal Reports, NHibernate.dll reference Log4Net

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.