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

Posted on 2009-02-20
Last Modified: 2013-12-09
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



      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 in new window

Question by:lancerxe

    Author Comment

    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


    Accepted Solution

    Nevermind Experts - I solved my own problem on my own.

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

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now