• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1030
  • Last Modified:

Why Am I getting this on ISQL Query - Overflow occurred during data type conversion. conversion error from string '05-21-2000'

Here is what my code-snip looks like in Delphi 7 below

Then during debug or runtime I got this error detail - >

Overflow occurred during data type conversion. conversion error from string '05-21-2000'

I do get same sql complaints on both Delphi runtime and in IB Expert.

This should be valid isql syntax.  Can someone help me please.

Thanks in advance.
with TQuery do begin
      Close;
      SQL.Clear;
      mysql := 'SELECT * FROM BATCH_RUN WHERE Add_date = ';
      mysql := mysql + ''''+ FormatDateTime( 'mm/dd/yyyy', 36665 ) + '''';
      mysql := mysql + ' AND rec_proc = ' + IntToStr( irecs );
      mysql := mysql + ' order by batch_id asc ';
      SQL.Add( mysql );
      Open;
      First;
end;

Open in new window

0
lancerxe
Asked:
lancerxe
  • 2
1 Solution
 
lancerxeAuthor Commented:
The sent query string would look like this on server ->
SELECT * FROM BATCH_RUN WHERE Add_date = '05-21-2000' AND rec_proc = 53 order by batch_id asc

Open in new window

0
 
lancerxeAuthor Commented:
Nevermind Experts - I solved my own problem on my own.

Thank you for your time.
SELECT * FROM
BATCH_RUN 
WHERE Add_date = CAST('05-21-2000' AS Date) 
AND rec_proc = 53 
order by batch_id asc

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now