You can also use the SQL
LIKE operator to find items
that match
a
pattern or wildcard search. Suppose you wanted a quick
list of
transactions where the account number ended in 001.
This query would return that information:
select rcpt_number, accounting_Date,
tran_Code,
user_id, cr_Account, extended_fee_amount
from detail_view_deptcode_2020
where cr_account like '%001' and
accounting_Date between '@startdate' and
'@enddate'
and tran_code = '1000'
and rcpt_status = 2
In this case the
cr_account like
'%-001'
portion of the
where tells the
program to look for any account numbers that start
with any string of characters and ends with
-001.
The
% sign is the SQL wildcard
character.
You can used wildcards on any portion of a field, for
example
%-123-% would match any value
that
contained
-123- anywhere within the
value.
You can also find receipts for a specific register
number
using
the LIKE operator.
The where clause :
where rcpt_number like '001-%'
would match receipts for register #001.
RASWIN allows you to specify variable search criteria
instead
of
hardcoded ones. For example you could look for
TRAN_CODE = '1000' in your
query or
you
could specify:
TRAN_CODE = '@TRAN_CODE'. In
the later case, the program will prompt you to enter
the value you are looking for when you use the "Get
Data" button. Your variable criteria can also use wild
cards, but your comparison
operator must then be
LIKE instead of
= , for exmaple:
TRAN_CODE like
'@TRAN_CODE'
When you enter your data value in response to the
request at
run-time, your
entry could be :
12%
which would match all codes starting with 12. Note
that the like operator will function just as the =
operator if there is a single matching value, e.g.,
LIKE '1234' would find only codes that are 1234, just
as the = sign operator would; however, this is less
slightly less efficient.