|
-
Jun 12th, 2006, 12:27 PM
#1
Thread Starter
New Member
Crystal Report9 Date format
Dear brother,
I am a hobist. I am working with VB6 and wants to report by Crystal Report9. I am using Access 2000 Data base.
I want to inter link Crystal report in VB6. I can connect and it is working with Record SelectionFurmula perfectly for Character and Number data.
But when I am using DATE Field in Recordselectionformula it is not working correctly. In data base I made DATE field Short Date.My Computer date format is also dd/mm/yyyy format .
In VB6 date query working working perfectly by format ( Examp: Format (# " & TextDate.text& "#,' mm/dd/yyyy'), bul in Crystal report9 it is not working.
Recordselectionformula can retrive dates 31/01/2006, 13/12/2006, But when Date is like 01/02/2006 or 05/06/2006 then it can't retrive any record.
Example :
Report.recordselectionformula="{TableName.DatefieldName}=#" & TextDate.Text & "#" #
If Possible help me. How can overcome it. I will be greatful to you.
Thanks
-
Jun 12th, 2006, 03:53 PM
#2
Addicted Member
Re: Crystal Report9 Date format
Have you tried it with a time of midnight? ("2005-04-29 00:00:00")
I know many of my databases store the time in with the date field.
VB 6 / VB.NET 2003, 2005 / Crystal Reports 9-12
-
Jun 13th, 2006, 03:28 PM
#3
Thread Starter
New Member
Re: Crystal Report9 Date format
Date can be displayed in "yyyy/mm/dd" format but I want to display in report in ""dd/mm/yyyy" . How can be done.
-
Jun 14th, 2006, 08:11 AM
#4
Hyperactive Member
Re: Crystal Report9 Date format
 Originally Posted by siraj107
Report.recordselectionformula="{TableName.DatefieldName}=#" & TextDate.Text & "#" #
Thanks
Do it in this way:
VB Code:
Report.recordselectionformula="{TableName.DatefieldName}=#" & Format(TextDate.Text,DD-MMM-YYYY) & "#" #
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Jun 14th, 2006, 04:29 PM
#5
Thread Starter
New Member
Re: Crystal Report9 Date format
Thank you for reply. I solved it in other way. But Your way is more easy and short.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|