Crystal Reports - need help w/ SelectionFormula property 
Author Message
 Crystal Reports - need help w/ SelectionFormula property

I'm trying to do a report with Crystal Reports (the control that comes
with VB4).  Everything is fine except when I try to set a selection
formula.  

Basicaly I have 2 TextBox controls where the user can enter the date
range wanted.  I want to take these ranges and apply them to a date
field in the database.

I thought the following would work, but I get an error that complains
about the data DLL (???):

Temp = "{Events.Date} >= " & trim(StartDate.Text) & " and  {Events.Date}
<= " & Trim(EndDate.Text)

Report1.SelectionFormula = Temp

Any ideas??

Jack Linder



Mon, 03 May 1999 03:00:00 GMT  
 Crystal Reports - need help w/ SelectionFormula property


Quote:
> I thought the following would work, but I get an error that complains
> about the data DLL (???):

I've had this before (the second most useless error message in VB's
reportoir) when the database has moved, you need to set the database
location in code before rptControl.Action = 1

Quote:

> Temp = "{Events.Date} >= " & trim(StartDate.Text) & " and  {Events.Date}

<= " & Trim(EndDate.Text)

Put nested quotes around dates, and you might try and format the
strings......

        Temp = "{Events.Date} >= '" & format(StartDate.Text,"dd/mm/yyyy") & "'
and  ......................

enjoy.

--
Chris Ashton
Applications Design Analyst

iQ Computing Limited, Uk



Mon, 03 May 1999 03:00:00 GMT  
 Crystal Reports - need help w/ SelectionFormula property

 I'm trying to do a report with Crystal Reports (the control that comes
 with VB4).  Everything is fine except when I try to set a selection
 formula.

Basicaly I have 2 TextBox controls where the user can enter the date
 range wanted.  I want to take these ranges and apply them to a date
 field in the database.

 I thought the following would work, but I get an error that complains
 about the data DLL (???):

 Temp = "{Events.Date} >= " & trim(StartDate.Text) & " and
{Events.Date}
 <= " & Trim(EndDate.Text)

 Report1.SelectionFormula = Temp

The problem is most likely that you haven't delimited the date.  Without
delimiters, the expression is assumed to be numeric; strings should be
delimited with " or ', and dates should be delimited one of two ways.

The Access query format allows use of # to delimit dates.  You need to
check the CR help for any variation in their scheme.  The other way to
do it (more reliable) is to use " table.column = CVDate('" & expression
& "'".  Again, check for a variant in CRs scheme of things.

For what it's worth, I became very frustrated trying to get CR to do the
data analysis correctly.  I now use it in the simplest of fashions by
extracting the data I want to print into a special table, and use CR to
dump that to the printer and do the control breaks.  It looks very
impressive when you see the kind of query you can specify, but you
should check very carefully that you get the right answer (compare with
the results of an Access query, or whatever DB you are using) - odds are
that the results are simply wrong.



Mon, 03 May 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Selectionformula property in Crystal Reports Control - Please help!

2. Need Help : Crystal Report SelectionFormula

3. Need help with SelectionFormula in Crystal Reports 4.6

4. Syntax for Crystal SelectionFormula Property

5. Syntax for Crystal SelectionFormula Property

6. SelectionFormula for Crystal Report???

7. How to use Crystal Report SelectionFormula based on a variable cominf from a textbox

8. Crystal Report SelectionFormula

9. VB and Crystal Report : Selectionformula with date

10. Crystal Reports/SelectionFormula

11. Setting Crystal Reports SelectionFormula thru VB4

12. SelectionFormula for Crystal Reports from VB

 

 
Powered by phpBB® Forum Software