> select case when (current_date > available) then ((end_date - > current_date) / 30) > when (current_date < available) then ((end_date - available) / > 30) > end > from listing > where case > 4 > > which yields: > ERROR: parser: parse error at or near ">" > > Does anyone know how I could accomplish this?
Try an alias: select case when (current_date > available) then ((end_date - current_date) / 30) when (current_date < available) then ((end_date - available) / 30) end as asdf from listing where asdf > 4 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly