hubyub
Posts: 4
|
| Posted: 07/26/2006, 2:54 PM |
|
Hi,
How do i modify the CONDITIONS to a certain WHERE clause in an SQL statement.
For example, i want to change the "="(equal) condition to a "<=" (less than or equal) in the code of SQL statement.
i am dealing with the below WHERE clause which is a bit too complex - please take a look at the code below.
i'll be very grateful if anyone can tell me how do implement the above mentioned 'condition' change to a criterion in the code itself.
Thanks
********************************************
'BuildTableWhere Method @22-3F6B1BAB
Public Sub BuildTableWhere()
Dim WhereParams
If Not WhereParameters Is Nothing Then _
Exit Sub
Set WhereParameters = new clsSQLParameters
With WhereParameters
Set .Connection = Connection
Set .ParameterSources = Parameters
Set .DataSource = Me
.AddParameter 1, "urls_TITLE", ccsText, Empty, Empty, Empty, False
.AddParameter 2, "urls_TYPE", ccsText, Empty, Empty, Empty, False
.AddParameter 3, "urls_AREA", ccsText, Empty, Empty, Empty, False
.Criterion(1) = .Operation(opContains, False, "TITLE", .getParamByID(1))
.Criterion(2) = .Operation(opContains, False, "TYPE", .getParamByID(2))
.Criterion(3) = .Operation(opContains, False, "AREA", .getParamByID(3))
.AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .opAND .Criterion(1), .Criterion(2)), .Criterion(3))
WhereParams = .AssembledWhere
If Len(Where) > 0 Then
If Len(WhereParams) > 0 Then _
Where = Where & " AND " & WhereParams
Else
If Len(WhereParams) > 0 Then _
Where = WhereParams
End If
End With
End Sub
'End BuildTableWhere Method
|
 |
 |
peterr
Posts: 5971
|
| Posted: 07/26/2006, 3:10 PM |
|
Please see: http://docs.codecharge.com/studio3/html/ProgrammingTech...HEREClause.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
hubyub
Posts: 4
|
| Posted: 07/26/2006, 3:16 PM |
|
thanks peter - in the past 5 minutes, i couldnt help my restless self and found out whats different about codecharge from rest of the SQL world.
it so happens that they have added all these operators (known to us as <=, =, >= etc. ) in a file classes.asp
SO, in the code i gave earlier, one has to change opEqual to opLessThanOrEqual to get it working to ones satisfaction.
the rest of the operators are as below
' ------- Operators --------------
Const opEqual = 00001
Const opNotEqual = 00002
Const opLessThan = 00003
Const opLessThanOrEqual = 00004
Const opGreaterThan = 00005
Const opGreaterThanOrEqual = 00006
Const opBeginsWith = 00007
Const opNotBeginsWith = 00008
Const opEndsWith = 00009
Const opNotEndsWith = 00010
Const opContains = 00011
Const opNotContains = 00012
Const opIsNull = 00013
Const opNotNull = 00014
|
 |
 |
hubyub
Posts: 4
|
| Posted: 07/26/2006, 3:18 PM |
|
oops - i just noticed u work for codecharge company - its a great software - been using it for almost 3 years now.
cheers
|
 |
 |
|