在2017-05-18和2017-05-18之間創建了現有數據,當我在CRM中使用「From」「To」來運行我的報表時,它不返回任何數據。接下來在Microsoft SQL Server Management Studio中,當我使用上述日期運行查詢時,它仍然不會返回數據,但是當我向查詢添加時間時,它會返回'2017-05-18 00:00:00:00之間'的所有現有數據。和'2017-05-18 23:59:59.000'兩個日期之間包含SSRS過濾器?
我怎樣才能在SSRS中解決這個問題,因此它會從相同的「From date」和相同的「To」日期返回數據?兩個日期之間包含SSRS過濾器?
SELECT
Account.mm_registrationnumber AS CL_Reg_Number,
Account.Name,
Account.mm_supplierstatus AS Supplier_Status,
Account.PrimaryContactIdName AS Primary_Contact,
Account.EMailAddress1 AS Email,
Account.Telephone1 AS Telephone,
mm_address.mm_line1 AS Line1,
mm_address.mm_line2 AS Line2,
mm_address.mm_line3 AS Line3,
mm_address.mm_line4 AS Line4,
mm_address.mm_city AS City,
mm_address.mm_county AS County,
mm_address.mm_postcode AS Postcode,
mm_turnover.mm_name AS Signup_Turnover,
Account.mm_signupdate AS SignUp_Date,
mm_payment.mm_paymenttype AS Payment_Type,
mm_payment.mm_paymentstatus AS Payment_Status,
mm_payment.mm_vatamount AS Payment_Amount_VAT,
mm_payment.mm_paymentamount AS Payment_Amount_Net,
Invoice.InvoiceNumber AS Invoice_ID,
Invoice.DueDate AS Due_Date,
Invoice.CreatedOn AS Created_Date
FROM Account
INNER JOIN mm_payment ON mm_payment.mm_organisation = Account.AccountId
INNER JOIN mm_address ON Account.mm_address = mm_address.mm_addressId
INNER JOIN mm_turnover ON Account.mm_turnover = mm_turnover.mm_turnoverId
INNER JOIN Invoice ON Invoice.AccountId = Account.AccountId
WHERE Invoice.CreatedOn between '2017-05-18 00:00:00.000' and '2017-05-18 23:59:59.000'
有沒有辦法在SSRS中做到這一點? – Sam
還是有辦法爲用戶從CRM報告中選擇的任何日期進行上述轉換嗎? – Sam
是的只是使用參數,然後用參數的佔位符替換日期文字。 –