Hi,
i have got a report that has a Form before it to set a filter.
In this report is the following code:
I have a problem with the LIKE statement.
I'm getting the values for the ChapterSelect from a lookuptable. This has values like
1
1.1
1.2
12
12.1
13
I would like to have the following functionality:
* When i select 1.1 it should return all records that have a chapternumber like '1.1*'
* When i select 1 it should return all records that have a chapter number like '1*'
Like this:
1
1.1
1.2
BUT, it should NOT return the values:
12
12.1
13
(the statement is performing correctly but this is not the functionality i would like)
---
It's never too late to do the Right thing
i have got a report that has a Form before it to set a filter.
In this report is the following code:
Code:
Status_Info_3 = ""
Chapter_Filter = ""
If (Forms!ReportSelector.ChapterSelect1.Column(1) <> Empty) Then
Chapter_Filter = "[Q7A_Chapter] Like '" & Forms!ReportSelector.ChapterSelect1.Column(1) & "*" & "'"
Status_Info_3 = "Chapter like: " + Forms!ReportSelector.ChapterSelect1.Column(1)
End If
If (Forms!ReportSelector.ChapterSelect2.Column(1) <> Empty) Then
If Chapter_Filter = "" Then
Chapter_Filter = Forms!ReportSelector.ChapterSelect1.Column(1) & "*" & "'"
Status_Info_3 = Forms!ReportSelector.ChapterSelect2.Column(1)
Else
Chapter_Filter = Chapter_Filter + " OR " + "[Q7A_Chapter] Like '" & Forms!ReportSelector.ChapterSelect1.Column(1) & "*" & "'"
Status_Info_3 = Status_Info_3 + " OR " + Forms!ReportSelector.ChapterSelect1.Column(1)
End If
End If
If (Forms!ReportSelector.ChapterSelect3.Column(1) <> Empty) Then
If Chapter_Filter = "" Then
Chapter_Filter = Forms!ReportSelector.ChapterSelect3.Column(1) & "*" & "'"
Status_Info_3 = "Chapter like: " + Forms!ReportSelector.ChapterSelect3.Column(1)
Else
Chapter_Filter = Chapter_Filter + " OR " + "[Q7A_Chapter] Like '" & Forms!ReportSelector.ChapterSelect3.Column(1) & "*" & "'"
Status_Info_3 = Status_Info_3 + " OR " + Forms!ReportSelector.ChapterSelect3.Column(1)
End If
End If
I have a problem with the LIKE statement.
I'm getting the values for the ChapterSelect from a lookuptable. This has values like
1
1.1
1.2
12
12.1
13
I would like to have the following functionality:
* When i select 1.1 it should return all records that have a chapternumber like '1.1*'
* When i select 1 it should return all records that have a chapter number like '1*'
Like this:
1
1.1
1.2
BUT, it should NOT return the values:
12
12.1
13
(the statement is performing correctly but this is not the functionality i would like)
---
It's never too late to do the Right thing