select case when datepart (mm,getdate())>3 then 'abc' else 2 end
Run Code Online (Sandbox Code Playgroud)
将varchar值'abc'转换为数据类型int时转换失败.
这是我的数据
Id Name Amt
1 ABC 20
2 XYZ 30
3 ABC 25
4 PQR 50
5 XYZ 75
6 PQR 40
Run Code Online (Sandbox Code Playgroud)
我希望每个特定名称的最后一条记录如:
3 ABC 25
5 XYZ 75
6 PQR 40
Run Code Online (Sandbox Code Playgroud)
我尝试过分组,但我错过了一些东西.
SELECT PatientID, Balance, PReceiptNo
FROM tblPayment
GROUP BY PatientID, Balance, PReceiptNo
Run Code Online (Sandbox Code Playgroud) 尝试使用以下代码编写PDF文档:
document = new Document();
PdfWriter writer = null; ;
try
{
writer = PdfWriter.GetInstance(document, new FileStream(@"E:\mergFiles", FileMode.Create));
}
catch (Exception xc)
{ }
Run Code Online (Sandbox Code Playgroud)
我得到一个例外:
{System.UnauthorizedAccessException: Access to the path 'E:\mergFiles' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) …Run Code Online (Sandbox Code Playgroud)