0

When we call this procedure

Call get_reports_by_time('2014-12-22 11:19:26 AM').

no data is returned

but when we call this

Call get_reports_by_time('2014-12-22 11:19:26 ')

all the records for that day is returned. why its so?

2
  • Add your stored procedure code to your posting. Commented Dec 22, 2014 at 11:42
  • get_reports_by_time is a function you (or your company) created, so it is relying on a format since you're probably not using timestamps.So we need to see your procedure to be able to help you Commented Dec 22, 2014 at 11:43

1 Answer 1

1

string representation of dates/timestamps,... is dependent on your db settings.

In your case one representation can be converted to a date (assuming that you work with a date type in your stored procedure) and one representation cannot be converted to a date.

I higly suggest to use date and time types and not any string representation for your paremeters (if you need a string representation then convert it by YOURSELF using date/str_to_date)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.