I have column in my table named billing_cycle which contains only below given two strings and i need to retrieve only monthly and Quarterly from that string.
Using the below query i can fetch string Quarterly properly but not string monthly.In the out put the word A overlapping with the string Monthly.It can be replaced using case and stuff command but i dont want to use those. I would like to get the output using substring and charindex or with any other function.
SELECT substring('208-Billing Period - Quarterly Average Daily Balance', charindex('- ', '208-Billing Period - Quarterly Average Daily Balance') + 2, 9)
SELECT substring('210-Billing Period - Monthly Average Daily Balance', charindex('- ', '210-Billing Period - Monthly Average Daily Balance') + 2, 9)
Anyone could help me?