like

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like" such as:
GGWDAYSOMKT: IIf([liststatus] like ("*expired*","*canceled*","*withdrawn*")
 
Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Strage, huh?
Ok, thanks.

John Spencer said:
Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like" such as:
GGWDAYSOMKT: IIf([liststatus] like ("*expired*","*canceled*","*withdrawn*")
 
troubleshoot this for me ?
GGWDAYSOMKT: IIf(liststatus like "*expired*" or liststatus like "*canceled*"
or liststatuslike "*withdrawn*" ,[orglstdate]-[OFFMKTDATE]),IIf(liststatus
like "*PEND*" or liststatus "*SOLD*",[orglstdate]-[SOLDDATE]),IIf(liststatus
Like "*active*",[orglstdate]-Date())))*-1)

John Spencer said:
Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like" such as:
GGWDAYSOMKT: IIf([liststatus] like ("*expired*","*canceled*","*withdrawn*")
 
--Missing space between ListStatus and Like
--Missing Like between ListStatus and "*Sold*"
--Unbalanced parentheses Extra parens after , [orglstdate]-[OFFMKTDATE] and
after , [orglstdate]-[SOLDDATE],
--Unclear why you are multiplying the results by -1. If you are trying to
remove the negative you can use ABS around the entire expression Or you can
reverse the calculations so that they return positive numbers


GGWDAYSOMKT: ABS( IIf (liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatus like "*withdrawn*"
, [orglstdate]-[OFFMKTDATE]
, IIf (liststatus like "*PEND*" or liststatus LIKE "*SOLD*"
, [orglstdate]-[SOLDDATE],
IIf (liststatus Like "*active*",[orglstdate]-Date()))))


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

sierralightfoot said:
troubleshoot this for me ?
GGWDAYSOMKT: IIf(liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatuslike "*withdrawn*" ,[orglstdate]-[OFFMKTDATE]),IIf(liststatus
like "*PEND*" or liststatus
"*SOLD*",[orglstdate]-[SOLDDATE]),IIf(liststatus
Like "*active*",[orglstdate]-Date())))*-1)

John Spencer said:
Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like" such
as:
GGWDAYSOMKT: IIf([liststatus] like
("*expired*","*canceled*","*withdrawn*")
 
How come when I enter this expression and then save, brackets automatically
are added around the "liststatus" and does this alter the results?


John Spencer said:
--Missing space between ListStatus and Like
--Missing Like between ListStatus and "*Sold*"
--Unbalanced parentheses Extra parens after , [orglstdate]-[OFFMKTDATE] and
after , [orglstdate]-[SOLDDATE],
--Unclear why you are multiplying the results by -1. If you are trying to
remove the negative you can use ABS around the entire expression Or you can
reverse the calculations so that they return positive numbers


GGWDAYSOMKT: ABS( IIf (liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatus like "*withdrawn*"
, [orglstdate]-[OFFMKTDATE]
, IIf (liststatus like "*PEND*" or liststatus LIKE "*SOLD*"
, [orglstdate]-[SOLDDATE],
IIf (liststatus Like "*active*",[orglstdate]-Date()))))


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

sierralightfoot said:
troubleshoot this for me ?
GGWDAYSOMKT: IIf(liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatuslike "*withdrawn*" ,[orglstdate]-[OFFMKTDATE]),IIf(liststatus
like "*PEND*" or liststatus
"*SOLD*",[orglstdate]-[SOLDDATE]),IIf(liststatus
Like "*active*",[orglstdate]-Date())))*-1)

John Spencer said:
Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================


sierralightfoot wrote:
GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like" such
as:
GGWDAYSOMKT: IIf([liststatus] like
("*expired*","*canceled*","*withdrawn*")
 
Access is adding the brackets to ensure that ListStatus is recognized as a
field.

No, it should not alter the results - which I think you could have detected
just by running the query.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

sierralightfoot said:
How come when I enter this expression and then save, brackets
automatically
are added around the "liststatus" and does this alter the results?


John Spencer said:
--Missing space between ListStatus and Like
--Missing Like between ListStatus and "*Sold*"
--Unbalanced parentheses Extra parens after , [orglstdate]-[OFFMKTDATE]
and
after , [orglstdate]-[SOLDDATE],
--Unclear why you are multiplying the results by -1. If you are trying
to
remove the negative you can use ABS around the entire expression Or you
can
reverse the calculations so that they return positive numbers


GGWDAYSOMKT: ABS( IIf (liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatus like "*withdrawn*"
, [orglstdate]-[OFFMKTDATE]
, IIf (liststatus like "*PEND*" or liststatus LIKE "*SOLD*"
, [orglstdate]-[SOLDDATE],
IIf (liststatus Like "*active*",[orglstdate]-Date()))))


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

sierralightfoot said:
troubleshoot this for me ?
GGWDAYSOMKT: IIf(liststatus like "*expired*" or liststatus like
"*canceled*"
or liststatuslike "*withdrawn*"
,[orglstdate]-[OFFMKTDATE]),IIf(liststatus
like "*PEND*" or liststatus
"*SOLD*",[orglstdate]-[SOLDDATE]),IIf(liststatus
Like "*active*",[orglstdate]-Date())))*-1)

:

Not really.

You have to do it the long way
IIF( ListStatus Like "*expired*" Or ListStatus Like "*Cancelled*" Or
ListStatus LIke "*Withdrawn*","X","Y")



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================


sierralightfoot wrote:
GGWDAYSOMKT: IIf([liststatus] In ("expired","canceled","withdrawn")

as in the format above, is there a similar way to structure "like"
such
as:
GGWDAYSOMKT: IIf([liststatus] like
("*expired*","*canceled*","*withdrawn*")
 
Back
Top