Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query between date and time

Status
Not open for further replies.

erik2131

IS-IT--Management
Dec 26, 2001
2
US
I tried to find an answer to this here but could not find anything really close. I am VERY new at using Crystal and am trying to build a report to search between dates and times. More specifically for example I need to search between 12/26/01 12:00:00 and 01/02/01 11:59:59. The database uses military time and this is the format it is in. If I search between these times nothing shows up, however if I leave the time off on the end date all the records appear. Can anyone help me out with an example on how to get this to work?
 
Erik,

How important is the time in your report?

If it is strictly a from-date/to-date situation, create a paramter field and make it a date data type (not a date/time data type). Also make it a range value. Then put something like the following into your record selection formula: {Datefiled in minimum({?daterangefield)) to Maximum({?daterangefield})

When the parameter prompts the user, enter the 2 dates. If you ever REALLY want anything that is not strictly a date cutoff, CR does support a date/time paramter and you can create the paramter field and fill in the question accordingly, but I have never worked with a date/time paramter so I cannot add any ideas on how to make this work.

Let me know if you have any questions.

Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
The time portion is extremely important. I have the report working for dates but the time is a key portion because we do the report from Noon - Noon and we need to keep it consistent otherwise it will throw our counts off. If anyone has any suggestions please let me know as I have been beating my head against my desk over this :)
 
Post the names of all fields involved here, and the data type that Crystal sees for each field. If you don't know what this means read faq149-732

Also post the selection formulas that you are trying and what the result is with each formula. I do not know what you mean by "all records show up". Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top