FILTERS
?
Expression Date Time in M, d yyyy hh:mm AM/PM format
=MonthName(Month(Fields!Most_Recent_Inspection_Date.Value),false)
& " " &
Day(Fields!Most_Recent_Inspection_Date.Value)
& ", " &
Year(Fields!Most_Recent_Inspection_Date.Value)
& " at " &
Switch(
Hour(Fields!Most_Recent_Inspection_Date.Value)=12,Hour(Fields!Most_Recent_Inspection_Date.Value) & ":" & IIF(Minute(Fields!Most_Recent_Inspection_Date.Value)<10,"0" & Minute(Fields!Most_Recent_Inspection_Date.Value) & " PM",Minute(Fields!Most_Recent_Inspection_Date.Value) & " PM"),
Hour(Fields!Most_Recent_Inspection_Date.Value)=0,"12:" & IIF(Minute(Fields!Most_Recent_Inspection_Date.Value)<10,"0" & Minute(Fields!Most_Recent_Inspection_Date.Value) & " AM",Minute(Fields!Most_Recent_Inspection_Date.Value) & " AM"),
Hour(Fields!Most_Recent_Inspection_Date.Value)>12,Hour(Fields!Most_Recent_Inspection_Date.Value)-12 & ":" & IIF(Minute(Fields!Most_Recent_Inspection_Date.Value)<10,"0" & Minute(Fields!Most_Recent_Inspection_Date.Value) & " PM",Minute(Fields!Most_Recent_Inspection_Date.Value) & " PM"),
Hour(Fields!Most_Recent_Inspection_Date.Value)<12,Hour(Fields!Most_Recent_Inspection_Date.Value) & ":" & IIF(Minute(Fields!Most_Recent_Inspection_Date.Value)<10,"0" & Minute(Fields!Most_Recent_Inspection_Date.Value) & " AM",Minute(Fields!Most_Recent_Inspection_Date.Value) & " AM"))
Owner Full Name
COALESCE(CASE
WHEN isnull(dbo.B3OWNERS.B1_OWNER_FNAME, '') + isnull(B3OWNERS.B1_OWNER_MNAME, '') + isnull(B3OWNERS.B1_OWNER_LNAME, '') <> ''
THEN CASE
WHEN isnull(B3OWNERS.B1_OWNER_MNAME, '') <> ''
THEN CASE
WHEN ISNULL(dbo.B3OWNERS.B1_OWNER_TITLE, '') <> ''
THEN dbo.B3OWNERS.B1_OWNER_TITLE
ELSE ''
END + B3OWNERS.B1_OWNER_FNAME + ' ' + B3OWNERS.B1_OWNER_MNAME + ' ' + B3OWNERS.B1_OWNER_LNAME
ELSE B3OWNERS.B1_OWNER_FNAME + ' ' + B3OWNERS.B1_OWNER_LNAME
END
ELSE NULL
END, CASE
WHEN isnull(B3OWNERS.B1_OWNER_FULL_NAME, '') <> ''
THEN B3OWNERS.B1_OWNER_FULL_NAME
ELSE NULL
END) AS 'Owner Full Name'
Contact Full Name
COALESCE(CASE
WHEN isnull(dbo.B3CONTACT.B1_FNAME, '') + isnull(B3CONTACT.B1_MNAME, '') + isnull(B3CONTACT.B1_LNAME, '') <> ''
THEN CASE
WHEN isnull(B3CONTACT.B1_MNAME, '') <> ''
THEN CASE
WHEN ISNULL(dbo.B3CONTACT.B1_TITLE, '') <> ''
THEN dbo.B3CONTACT.B1_TITLE
ELSE ''
END + B3CONTACT.B1_FNAME + ' ' + B3CONTACT.B1_MNAME + ' ' + B3CONTACT.B1_LNAME
ELSE B3CONTACT.B1_FNAME + ' ' + B3CONTACT.B1_LNAME
END
ELSE NULL
END, CASE
WHEN isnull(B3CONTACT.B1_FULL_NAME, '') <> ''
THEN CASE
WHEN ISNULL(dbo.B3CONTACT.B1_TITLE, '') <> ''
THEN dbo.B3CONTACT.B1_TITLE
ELSE ''
END + B3CONTACT.B1_FULL_NAME
ELSE NULL
END, CASE
WHEN ISNULL(dbo.B3CONTACT.B1_BUSINESS_NAME,'') <> '' THEN dbo.B3CONTACT.B1_BUSINESS_NAME ELSE NULL END) AS 'Contact Full Name'
Monday, September 30, 2013
SSRS 2008 R2 Snippets
Today's Date
Inside an Internal Parameter as a Default Value:
=MonthName(Month(Now()),false) & " " & Day(Now()) & ", " & Year(Now())
Format Currency
=Format(10000 - First(Fields!Fee_Total.Value, "HousingDeptWFee"),"C")
Inside an Internal Parameter as a Default Value:
=MonthName(Month(Now()),false) & " " & Day(Now()) & ", " & Year(Now())
Format Currency
=Format(10000 - First(Fields!Fee_Total.Value, "HousingDeptWFee"),"C")
Sunday, September 1, 2013
My Solution to the Coconuts and Monkey Problem
This applies to the problem located here http://orion.math.iastate.edu/burkardt/puzzles/coconut_solution.html. I guess I could have made the function recursive but I want to move onto other things. This was done in java.
public class main {public static void main(String[] args) {// TODO Auto-generated method stubfloat total = 0;math_functions mf = new math_functions();for(float x=20000 ; x>0 ; x--){total = (mf.coconuts(mf.coconuts(mf.coconuts(mf.coconuts(mf.coconuts(mf.coconuts(x)))))));if(total%1 == 0 && total > 0){System.out.println("total left " + total + " starting coconuts " + (x));//break;}}}
public float coconuts(float x) { float total = (float)(4*((x/5)-.2)); if(total%1 != 0){ return 0; }else{ return total; } }
}
Monday, August 5, 2013
Javascript Change Date Time to Military Format
No leading 0 for hour, always leading zero for minute on the input time.
function COSconvertto24hourtime(otime,ampm){
var newtime = '';
if (typeof otime != 'undefined') {
var hh = otime.substring(0, otime.indexOf(':'));
var mm = otime.substring(otime.indexOf(':')+1, otime.indexOf(':') + 3);
if(hh == 12){
hh = 0;
}
if (ampm.indexOf('PM') >= 0) {
hh = 12 + parseFloat(hh);
}
if (hh < 10) {
hh = '0' + hh;
}
newtime = '' + hh + ':' + mm + ':00';
} else {
newtime = NULL;
}
return newtime;
}
Thursday, August 1, 2013
Wednesday, July 31, 2013
Handy MsSQL Snippets
Force Items To Top Of Order By
ORDER BY
CASE
WHEN guide_item_text like '%condemnation%' then '1' + guide_item_text
ELSE '2' + guide_item_text
END DESC
ORDER BY
CASE
WHEN guide_item_text like '%condemnation%' then '1' + guide_item_text
ELSE '2' + guide_item_text
END DESC
Subscribe to:
Posts (Atom)