Forum Discussion
ckattookaran
VIP
Depending on where you are running this SQL query, can't you get the year from the user entry and use a loop to build your SQL query like something similar?
dim strUserTime as String
dim intUserYear as integer = Left(strUserTime,4)
dim intUserPriorYear as integer = intUserYear-1
Dim lstTimeList As new List(of String)
For each i = 1 to 12
lstTimeList.Add($"{intUserPriorYear}M{i}")
Next
Now you can then do String.Join(", ", lstTimeList), to get the whole list of time.
Rithik_Prem
2 years agoNew Contributor III
Hi,
I was wondering if you could please elaborate further on the solution you provided.
Related Content
- 4 months ago
- 11 months ago
- 3 years ago
- 3 years ago