1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
Response.ContentType = "application/pdf" 'Variable declaration Dim objStream Dim fileRS, fileSQL Const adTypeBinary = 1 fileSQL = "SELECT fileName, fileData FROM tblAuditDocs WHERE tblAuditDocs.auditDocID = " + fileID Set fileRS = Server.CreateObject("ADODB.Recordset") fileRS.Open fileSQL,oConn,1,1,1 If Not(fileRS.EOF) Then Response.ContentType = "application/pdf" Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = adTypeBinary objStream.Write fileRS("fileData").value 'IMPORTANT: Must set position at the beginning of the stream objStream.Position = 0 Response.BinaryWrite objStream.Read 'Response.End Set objStream = Nothing End If fileRS.Close Set fileRS = Nothing
oh my friend, you're using text datatype. That's not good. are you using SQL 2005? If so, then I urge you to change it to varchar(max) in order to avoid yourself lots of trouble in the future. If you're using SQL 2000, then definitively consider varchar(8000). In the mean time, we can try with "like" operator instead
1: 2: 3:
select a.* from payment a inner join notesTEST b on a.id = b.CUSTOMER_id and dateadd(d, datediff(d, 0, a.[date]), 0) >= dateadd(d, datediff(d, 0, b.[date]), 0) and b.notes like '%' + cast(abs(A.value) as varchar) + '%'