Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: How can I insert a where clause This code please Post Reply Post New Topic
Author Message
marztar
Newbie
Newbie
Avatar

Joined: 29 Dec 2012
Location: Jordan
Online Status: Offline
Posts: 2
Quote marztar Replybullet Topic: How can I insert a where clause This code please
    Posted: 29 Dec 2012 at 5:23am
Hi :)

How are you all ? Well, I'm new ere as I was facing a problem that could be an easy one to so many of you . I am working with VB6 and designing my reports using Crystal report 4.6 . I have set my sql statement ready to search between 2 dates . now I want to add another criteria to the same statement which is I have a field called "Carrier" in the same table "Exp" so the records that i want to show in the report are the ones that have a carrier which is given in a textbox but still its between the 2 dates . this is my code .


'''''''''''''''''''''''''''''''''''''''''''''''
On Error Resume Next
Dim j
Dim counterx
Dim i As Integer
j = GetSetting("Shipping", "1", "Path")
For i = 1 To Len(j)
counterx = Mid(Right(j, i), 1, 1)
If counterx = "\" Then
counterx = Mid(j, 1, Len(j) - i) & "\expetd.rpt"
CrystalReport1.ReportFileName = counterx
CrystalReport1.SelectionFormula = "{Exp.ETD} In Date(" & Format(Text1.Text, "yyyy,mm,dd") & ") To Date(" & Format(Text2.Text, "yyyy,mm,dd") & ")"
CrystalReport1.Action = 1
Exit Sub
End If
Next
'''''''''''''''''''''''''''''''''''''''''''''''
IP IP Logged
marztar
Newbie
Newbie
Avatar

Joined: 29 Dec 2012
Location: Jordan
Online Status: Offline
Posts: 2
Quote marztar Replybullet Posted: 31 Dec 2012 at 11:44pm
Someone help me please :/
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Jan 2013 at 7:47am
You'll change your selection formula.  It will look something like this:
 
CrystalReport1.SelectionFormula = "{Exp.ETD} In Date(" & Format(Text1.Text, "yyyy,mm,dd") & ") To Date(" & Format(Text2.Text, "yyyy,mm,dd") & "{MyTable.Carrier} = " & Text3.Text & ")"
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.