issue with Date Format in SSRS
-
Hi Team, I have two textboxes for taking startdate and enddate. If I give start date 10/01/2009 and Enddate 10/12/2009 then report should display 01st - 12th Oct'09 If start date is 10/02/2009 then it should display 02nd -12th Oct'09 Kindly help me
-
Hi Team, I have two textboxes for taking startdate and enddate. If I give start date 10/01/2009 and Enddate 10/12/2009 then report should display 01st - 12th Oct'09 If start date is 10/02/2009 then it should display 02nd -12th Oct'09 Kindly help me
This question connect to other post Date Time String formats[^]
String str1 = DateTime.Now.ToString("dd"); //12
String str2;if (str1 == "01")
str2 = "st"
else if (str1 == "02")
str2 = "nd";
else if (str1 == "03")
str2 = "rd";
else
str2 = "th";String str3 = DateTime.Now.ToString("MMM"); //Oct
String str4 = DateTime.Now.ToString("yy"); //09String date = str1+str2+ " " + str3+ "'"+ str4; //12th Oct'09
This task is dead easy. I showed how i did get custom format. Normal string formating doesn't show "st, nd, rd, th" (At least I think that whay) and doesn't allow chars as "'" Edit: Pre tags added
-
This question connect to other post Date Time String formats[^]
String str1 = DateTime.Now.ToString("dd"); //12
String str2;if (str1 == "01")
str2 = "st"
else if (str1 == "02")
str2 = "nd";
else if (str1 == "03")
str2 = "rd";
else
str2 = "th";String str3 = DateTime.Now.ToString("MMM"); //Oct
String str4 = DateTime.Now.ToString("yy"); //09String date = str1+str2+ " " + str3+ "'"+ str4; //12th Oct'09
This task is dead easy. I showed how i did get custom format. Normal string formating doesn't show "st, nd, rd, th" (At least I think that whay) and doesn't allow chars as "'" Edit: Pre tags added
Instead using
else if
I prefer usingswitch
. :)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
Instead using
else if
I prefer usingswitch
. :)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
i woud use else if because it is small code. I would use Switch for bigger operation
-
i woud use else if because it is small code. I would use Switch for bigger operation
I prefer
switch
for small and bigger cases.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com