?
Solved

Crystal Report 9.0 Date Range String

Posted on 2009-04-09
9
Medium Priority
?
309 Views
Last Modified: 2012-05-06
I have a date and time value (String) that looks like this:

02/01/2005 08:49:04
I would like to display only field DateValue (TICKETDATE [1 to 10] in {?receivedDate} to {?EndDate} and it keeps bringing back an error DateRange required over {?ReceivedDate} and {?EndDate}

I would like the display to show dates begining 10/01/2008 - 03/31/2009

Please Help
0
Comment
Question by:cdmccoy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 24110984
Are the parameters date types?

mlmcc
0
 

Author Comment

by:cdmccoy
ID: 24111004
String Datetime.  
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24111049
There is no type like that.
So is one of them a string abd the other a datetime?

If so you will have to convert the sting to a date also

mlmcc
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:cdmccoy
ID: 24111090
Exactly -- I need to convert the string to a date

The data when I pull the field it shows 02/01/2005 08:49:04 format
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24111124
Your formula seems to be doing that.  You may need to convert one of the parameters also in the same way.

mlmcc
0
 

Author Comment

by:cdmccoy
ID: 24111213
Let me explain better.  The database field is in a datetime format 02/01/2005 08:49:04 format.  I would like to pull a select criteria for it to look for records, TICKETDATE >= '10/01/2008" TO TICKETDATE <= '03/31/2009'

It displays an error message "Bad Date Format".  When I try --> DateTimeValue {TICKETDATE} [1 TO 10]), It again states that I have a bad date format.  Please Heeelp.  What am I doing wrong.  The field TICKDATE is a string.
0
 

Author Comment

by:cdmccoy
ID: 24115440
Would someone please assist me if you can?  I know it's a holiday.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 24116684
If you are hardcoding try this
Your ticket date is a date or datetime filed not a string
Date({TicketDate}) IN Date(2008,10,01) to Date(2009,3,31)

If you are using parameters make the start and end date DATE type and use
Date({TicketDate}) IN {?startdate} to {?enddate}

If ticketdate is a string then
Date(Val(Mid({TicketDate},7,4),Val(Mid({TicketDate},1,2),Val(Mid({TicketDate},4,2))  IN Date(2008,10,01) to Date(2009,3,31)

mlmcc
0
 

Author Comment

by:cdmccoy
ID: 24117487
Thank you sooooo much this one worked for me... Date({TicketDate}) IN Date(2008,10,01) to Date(2009,3,31).  Did I explain it incorrectly the first time?  You got it on the first try.....
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question