I have a table named @table1 which have two field one LoginDate and another Name field.
| Date | Name |
| 01/10/2024 10:00:00 AM | Mr. Deb Kumar |
| 1/10/2024 12:30:00 PM | Mr. Srinibash |
I want to create a view @table2 like below;
| Greetings | Name |
| Good Morning | Mr. Deb Kumar |
| Good Afternoon | Mr. Srinibash |
I want if Date field's Time value is between 6:00:00 to 12:00:00 then Greetings will be Good Morning and if Time value is between 4:00:00 to 5:00:00 then Greetings will be Good Afternoon and so on. How can i do this?
Jignesh KumarPosted Oct 1, 2024, 2:09 PM
Hello,
Debashish MahontaPosted Oct 2, 2024, 3:59 AM
@Jignesh Kumar How can i do that?
Jignesh KumarPosted Oct 2, 2024, 3:15 AM
Yo need to do change in string aggrigate function.
Debashish MahontaPosted Oct 2, 2024, 2:42 AM
@Jignesh Kumar sorry for late reply. Your above code is working fine. But I got one problem. I want to add 'And' before the last concate word and full stop symbol at the end.
Example: concate word1, word2, word3 and last word.
Debashish MahontaPosted Oct 1, 2024, 1:39 PM
@Amit Mohanty Thanks for quick reply.
I concated two column into one column which TourDate is same and GroupBy Date from below tableTour:
Code Used:
Result
I want to add 'At Morning', 'At Evening' etc text to start of VisitedPlace text like Below;
How can i do this?
Jignesh KumarPosted Oct 1, 2024, 1:01 PM
Hello,
You can use DatePart function to achieve this,
You can select from GreetingView,
Amit MohantyPosted Oct 1, 2024, 12:33 PM
Check this