Solved

Problem with Date format in crystal report

Posted on 1998-07-15
3
188 Views
Last Modified: 2010-08-05
Dear sir,
Now, I use Microsoft Access 95 as my database and Visual Basic 4.0. After I finished my crystal report. I try to select group of record with SelectionFormula . But I can't get any report after I try to send in a date format. How can I solve this problem? I have tried for several ways which I know but it's not work..

Such as;

crystalreport1.selectionformula = "{tblrpt.somedate} = #" & format(maskedbox1.text, "mm/dd/yy") & "#"

or

crystalreport1.selectionformula = "{tblrpt.somedate} = #" & cvdate(maskedbox1.text) & "#"

or

crystalreport1.selectionformula = "{tblrpt.somedate} = " & cvdate(maskedbox1.text)

PS. I format my date as short date format.
0
Comment
Question by:Mcblake
[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
  • 2
3 Comments
 

Accepted Solution

by:
biko071598 earned 50 total points
ID: 1465834
CRW uses a different date specifier.  Make sure your reports have "Convert Date-Time to Date" checked in options and use the following syntax.

crystalreport1.selectionformula = "{tblrpt.somedate} = date(1998,05,02)"

date has a parm format of date(yyyy,mm,dd).

 

instead of this:
"crystalreport1.selectionformula = "{tblrpt.somedate} = #" & format(maskedbox1.text, "mm/dd/yy") & "#" "


There are little issues selecting dates in CRW.  It is almost always better to specifiy a date range rather than a single date.
i.e. instead of  {some.date} = date(1997,1,1) use {some.date} >= date(1997,1,1) and {some.date} < (1997,1,2)

Good Luck

0
 

Expert Comment

by:Jules_Madgwick
ID: 5018604
biko,
I have tried your code
RUNSHEET_HISTORY.RUN_DATE
 & it doesn't work for me!
0
 

Expert Comment

by:Jules_Madgwick
ID: 5018619
biko,
I have tried your code
crystalreport1.selectionformula = "{tblrpt.somedate} = date(1998,05,02)"

 & it doesn't work for me!
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 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