You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

PS Query - Need the SQL to create a REPLACE statement

1 reply [Last post]
Guest's picture
Guest

I am still learning how to build and manipulate queries within PeopleSoft and I'm certainly no expert with SQL, but I am looking to find the correct statement to have the query look at a person's years of service with the company (which is calculated using an expression) and when the person's years of service are 5, 10, 15, 20 years, I need the query to return a character, such as *, in a separate field. I cannot build this into the criteria because I do not want to exclude those rows of data where the years of service are other than 5, 10, 15 and so on. I think I need an expression, but I'm not sure where to start. This is to help us tag who is reaching a milestone anniversary. Can anyone help?

accasey's picture
User offline. Last seen 2 years 27 weeks ago. Offline
Joined: 06/12/2009
Posts: 5
Re: PS Query - Need the SQL to create a REPLACE statement

Could you use a case statement,eg

SELECT CASE YOUR_EXPRESSION WHEN = '5' THEN '5' CONCAT '* WHEN = '20' THEN '20*' ELSE YOUR_EXPRESSION END
FROM SOMETHING

??

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.