This commit is contained in:
RDeck 2025-09-23 11:02:26 -04:00
parent df9f07a07a
commit f52a013e3f
11 changed files with 34 additions and 9 deletions

Binary file not shown.

View File

@ -72,9 +72,9 @@
"RelativeDocumentMoniker": "ClsConversions.cs", "RelativeDocumentMoniker": "ClsConversions.cs",
"ToolTip": "C:\\Repos\\SqlCustomFunctions\\ClsConversions.cs", "ToolTip": "C:\\Repos\\SqlCustomFunctions\\ClsConversions.cs",
"RelativeToolTip": "ClsConversions.cs", "RelativeToolTip": "ClsConversions.cs",
"ViewState": "AgIAACIAAAAAAAAAAAAqwEgAAAANAAAAAAAAAA==", "ViewState": "AgIAADgAAAAAAAAAAAAAAE8AAAAQAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-09-23T11:04:08.946Z", "WhenOpened": "2025-09-23T11:15:50.492Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
@ -85,7 +85,7 @@
"RelativeDocumentMoniker": "IPFunctions.cs", "RelativeDocumentMoniker": "IPFunctions.cs",
"ToolTip": "C:\\Repos\\SqlCustomFunctions\\IPFunctions.cs", "ToolTip": "C:\\Repos\\SqlCustomFunctions\\IPFunctions.cs",
"RelativeToolTip": "IPFunctions.cs", "RelativeToolTip": "IPFunctions.cs",
"ViewState": "AgIAADUAAAAAAAAAAAAqwBkAAAAAAAAAAAAAAA==", "ViewState": "AgIAADUAAAAAAAAAAAAqwDwAAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-07-10T13:15:33.845Z", "WhenOpened": "2025-07-10T13:15:33.845Z",
"EditorCaption": "" "EditorCaption": ""

View File

@ -72,9 +72,9 @@
"RelativeDocumentMoniker": "ClsConversions.cs", "RelativeDocumentMoniker": "ClsConversions.cs",
"ToolTip": "C:\\Repos\\SqlCustomFunctions\\ClsConversions.cs", "ToolTip": "C:\\Repos\\SqlCustomFunctions\\ClsConversions.cs",
"RelativeToolTip": "ClsConversions.cs", "RelativeToolTip": "ClsConversions.cs",
"ViewState": "AgIAACAAAAAAAAAAAAAqwDUAAABeAAAAAAAAAA==", "ViewState": "AgIAADgAAAAAAAAAAAAAAE8AAAAmAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-09-23T11:04:08.946Z", "WhenOpened": "2025-09-23T11:15:50.492Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
@ -85,7 +85,7 @@
"RelativeDocumentMoniker": "IPFunctions.cs", "RelativeDocumentMoniker": "IPFunctions.cs",
"ToolTip": "C:\\Repos\\SqlCustomFunctions\\IPFunctions.cs", "ToolTip": "C:\\Repos\\SqlCustomFunctions\\IPFunctions.cs",
"RelativeToolTip": "IPFunctions.cs", "RelativeToolTip": "IPFunctions.cs",
"ViewState": "AgIAADUAAAAAAAAAAAAqwBkAAAAAAAAAAAAAAA==", "ViewState": "AgIAADUAAAAAAAAAAAAqwDwAAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-07-10T13:15:33.845Z", "WhenOpened": "2025-07-10T13:15:33.845Z",
"EditorCaption": "" "EditorCaption": ""

View File

@ -54,7 +54,6 @@ namespace SqlCustomFunctions
SqlDateTime rv = dtSerial(InDate.Value.Year, Convert.ToInt16(InDate.Value.Month + 1), 0); SqlDateTime rv = dtSerial(InDate.Value.Year, Convert.ToInt16(InDate.Value.Month + 1), 0);
return rv; return rv;
} }
[Microsoft.SqlServer.Server.SqlFunction()] [Microsoft.SqlServer.Server.SqlFunction()]
public static SqlDateTime dtSerial(int year, short month, short day) public static SqlDateTime dtSerial(int year, short month, short day)
{ {
@ -73,6 +72,22 @@ namespace SqlCustomFunctions
return dt; return dt;
} }
[Microsoft.SqlServer.Server.SqlFunction()]
public static SqlString dtReportDateRange(SqlDateTime date1, SqlDateTime date2)
{
SqlString rv = string.Empty;
if (date1.CompareTo(date2) == 0)
rv = string.Format("{0:ddd MMM d, yyyy}", date1.Value);
else if (date1.Value.Year == date2.Value.Year)
rv = string.Format("{0:ddd MMM d} - {1:ddd MMM d, yyyy}", date1.Value, date2.Value);
else
rv = string.Format("{0:ddd MMM d, yyyy} - {1:ddd MMM d, yyyy}", date1.Value, date2.Value);
return rv;
}
//[Microsoft.SqlServer.Server.SqlFunction()]
private static DateTime DateSerial(int year, short month, short day) private static DateTime DateSerial(int year, short month, short day)
{ {
if (year < 0) if (year < 0)

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -5,3 +5,7 @@ C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.sqlproj.AssemblyRefer
C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.sqlproj.CoreCompileInputs.cache C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.sqlproj.CoreCompileInputs.cache
C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.dll C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.dll
C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.pdb C:\Repos\SqlCustomFunctions\obj\Release\SqlCustomFunctions.pdb
C:\Repos\SqlCustomFunctions\obj\Release\Model.xml
C:\Repos\SqlCustomFunctions\obj\Release\refactor.xml
C:\Repos\SqlCustomFunctions\obj\Release\postdeploy.sql
C:\Repos\SqlCustomFunctions\obj\Release\predeploy.sql