|
-
Feb 16th, 2006, 02:51 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] I can't understand recordselectionformula
Hi guys! This is my first time to use a recordselectionformula on Crystal Reports 10. I get this error that the date-time is required and it points me to this code:
VB Code:
AnAccountReport.RecordSelectionFormula = "{Account_Code.Account_Code} >= '" & Trim(Text1.Text) & "' and" _
& "{Account_Code.Account_Code} <= '" & Trim(Text2.Text) & "' and " _
& "{GL_Table.Date} >= '" & Format(DTPicker1.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} <= '" & Format(DTPicker2.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} >= DateTime (2004, 08, 1,00, 00, 00) " _
& "and " _
& "if {GL_Table.Date} = '" & Format(DTPicker1.Value, "MM/dd/yyyy hh:mm:ss") & "' then " _
& "{GL_Table.Entry_Type} <> 'BB' " _
& "Else " _
& "{GL_Table.Entry_Type} <> ''"
Is there something wrong?
-
Feb 16th, 2006, 03:01 AM
#2
Re: I can't understand recordselectionformula
VB Code:
& "{GL_Table.Date} >= '" & Format(DTPicker1.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} <= '" & Format(DTPicker2.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} >= DateTime (2004, 08, 1,00, 00, 00) " _
why are you checking the date for 3 times....
use Date as [Date]
{GL_Table.[Date]}
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Feb 16th, 2006, 03:02 AM
#3
Re: I can't understand recordselectionformula
is your GL_Table.[Date] is having the same format of "MM/dd/yyyy hh:mm:ss"
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Feb 16th, 2006, 03:03 AM
#4
Thread Starter
Hyperactive Member
Re: I can't understand recordselectionformula
 Originally Posted by ganeshmoorthy
VB Code:
& "{GL_Table.Date} >= '" & Format(DTPicker1.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} <= '" & Format(DTPicker2.Value, "MM/dd/yyyy hh:mm:ss") & "' and " _
& "{GL_Table.Date} >= DateTime (2004, 08, 1,00, 00, 00) " _
why are you checking the date for 3 times....
use Date as [Date]
{GL_Table.[Date]}
The first date is the starting date or from date.
The second date is the to date.
The third date is the filtering date.
-
Feb 16th, 2006, 03:06 AM
#5
Thread Starter
Hyperactive Member
Re: I can't understand recordselectionformula
 Originally Posted by ganeshmoorthy
is your GL_Table.[Date] is having the same format of "MM/dd/yyyy hh:mm:ss"
Well its a datetime variable and its format is MM/dd/yyyy
-
Feb 16th, 2006, 03:08 AM
#6
Re: I can't understand recordselectionformula
then why are you passing the date with time...
just send MM/dd/yyyy
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Feb 16th, 2006, 03:12 AM
#7
Thread Starter
Hyperactive Member
Re: I can't understand recordselectionformula
 Originally Posted by ganeshmoorthy
then why are you passing the date with time...
just send MM/dd/yyyy
Well I also did that but I still have the same error.
-
Feb 16th, 2006, 04:03 AM
#8
Thread Starter
Hyperactive Member
Re: I can't understand recordselectionformula
Now I know why I haven't managed to move on. I must add a DATETIME function in the recordselectionformula.
Thanks anyway.
-
Feb 16th, 2006, 07:22 AM
#9
Re: I can't understand recordselectionformula
Moved to reporting section.
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
|