iluvwitter
MIS
Hi,
I am trying to return multiple values using select/case statements and include those values in a text message and send via sql mail.
The table will display which jobs have ran via codes. I want to gather all the codes that ran today and substitute the codes with a different value.
Let's say dataset is:
Time Code
2009-07-22 17:35:02:597 A
2009-07-22 19:35:02:597 C
I am not sure how to go about this. So if A and C were run today, then the query would return: "Report Apple and Report Cat were run today". I think I would need to use some sort of text variable for each code returned today and send the text variable via SQL mail. Originally I created one select statement with several case...when statements but im not sure how i actually take the values, substitue the codes with a new value (Report Apple or Report Cat), and generate a text message with the new values.
Any help is appreciated. Thanks!
I am trying to return multiple values using select/case statements and include those values in a text message and send via sql mail.
The table will display which jobs have ran via codes. I want to gather all the codes that ran today and substitute the codes with a different value.
Let's say dataset is:
Time Code
2009-07-22 17:35:02:597 A
2009-07-22 19:35:02:597 C
I am not sure how to go about this. So if A and C were run today, then the query would return: "Report Apple and Report Cat were run today". I think I would need to use some sort of text variable for each code returned today and send the text variable via SQL mail. Originally I created one select statement with several case...when statements but im not sure how i actually take the values, substitue the codes with a new value (Report Apple or Report Cat), and generate a text message with the new values.
Any help is appreciated. Thanks!