Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with Date format in crystal report

Posted on 1998-07-15
3
Medium Priority
?
190 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

715 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