SSRS and Oracle data comparison
I have an SSRS report that uses the Date/Time parameter. The value it produces is in the form
- 7/27/2011 10:17:00 AM
I am doing a comparison on my data table in Oracle but ge开发者_如何学运维tting no results back. The format of the date in the data table is
- 07/28/2009 12:00:00.0000 AM
The SQL Query is doing this comparison
- EXPIRATION_DATE < to_date('07/27/2011 12:00:00','MM/DD/YYYY HH:MI:SS')
I've tried several varieties of formatting but not having any luck.
Any Ideas?
Figured it out....
Use this mask in the Oracle SQL Query as the parameter looks 7/27/2011 10:17:00 AM :
- to_date(:EXP_DATE,'MM/DD/YYYY HH:MI:SS')
And replace the AM or PM from the SSRS paramater:
- =Parameters!Exp_Date.Value.ToString().Replace(" AM","").Replace(" PM","")
Wow....who knew that the AM PM would throw a month error? Also, I tried with the 'MM/DD/YYYY HH:MI:SS AM' mask and still got the month error
精彩评论