Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

10.09 breaks SQL cast function

edited July 2008 in General
Hi,

I've got a report that uses a SQL cast call which works in 10.08 but fails
in 10.09.

The report is a monthly summary report. During data retrieval, I extract
out the month and year from the transaction date and create a Char field
from that information to use as the group break condition. The Expression
used to create this Char field is

cast( Extract(Month from invoice.Transdate) as char(2))
+ '/'
+ cast( Extract(Year from invoice.Transdate) as char(4))


In 10.08, the Magic SQL generated is as follows and works as expected:

SELECT invoice.TransDate,
cast( Extract(Month from invoice.Transdate) as char(2)) + '/' +
cast( Extract(Year from invoice.Transdate) as char(4))
cast_Extract_Month_from_i,
invitem.Quantity*invitem.Price invitem_Quantity_invitem
FROM invoice invoice
INNER JOIN invitem invitem ON
(invitem.Number = invoice.Number)
ORDER BY invoice.TransDate


In 10.09, the Magic SQL generated is as follows but is an invalid SQL query
that won't run:

SELECT invoice.TransDate,
cast( Extract(Month from invoice.Transdate) as char(2)) + '/' +
cast( Extract(Year from invoice.Transdate) cast_Extract_Month_from_i,
invitem.Quantity*invitem.Price invitem_Quantity_invitem
FROM invoice invoice
INNER JOIN invitem invitem ON
(invitem.Number = invoice.Number)
ORDER BY invoice.TransDate


Let me know if you need anything else to reproduce this and get it
corrected.

--

---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com

Atrex Inventory Control/POS -
Big business features without spending big business bucks!

Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
Email: mailto:support@atrex.com

Comments

  • edited July 2008

    I emailed you a patch. Registered users can email
    support@digital-metaphors.com to request the patch.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2008
    Nard,


    That did the trick.

    And thank you so much for the quick turnaround. It is greatly appreciated.

    --

    ---------------------------------------
    Terry Swiers
    Millennium Software, LLC
    http://www.1000years.com
    http://www.atrex.com

    Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

    Atrex Electronic Support Options:
    Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
    Email: mailto:support@atrex.com
This discussion has been closed.