Kaseya Community

Query to update Description on SD Hour entries

  • HI,

    we are getting a lot of questions about the unclarity of the invoices (all about hours from SD). SD only passes the ticketnumber and not the ticket summary to SB.

    so i created this select query:

    'select KSB.BillableLineDetails.Description, KSB.BillableLineDetails.DetailTypeID,kasadmin.sdincident.ref, kasadmin.sdincident.sdSummary

    'from KSB.BillableLineDetails

    'LEFT JOIN kasadmin.sdincident

    'ON left(KSB.BillableLineDetails.Description,8)=kasadmin.sdincident.ref

    'where (KSB.BillableLineDetails.DetailTypeID=0 and LEN(KSB.BillableLineDetails.Description) = 9 and KSB.BillableLineDetails.Description like 'IN%')

    and noticed the results i saw were what i wanted to see, so i created the UPDATE query below but it's giving me an error on LEFT JOIN

    'UPDATE KSB.BillableLineDetails

    'SET KSB.BillableLineDetails.Description = KSB.BillableLineDetails.Description & kasadmin.sdincident.sdSummary

    'LEFT JOIN kasadmin.sdincident

    'ON left(KSB.BillableLineDetails.Description,8)=kasadmin.sdincident.ref

    'where (KSB.BillableLineDetails.DetailTypeID=0 and LEN(KSB.BillableLineDetails.Description) = 9 and KSB.BillableLineDetails.Description like 'IN%')

    any help is very welcome !

    thanks 

  • just in case anybody is intrested :-)

    this is the working update query

    UPDATE KSB.BillableLineDetails

    SET KSB.BillableLineDetails.Description = KSB.BillableLineDetails.Description + ' ' + kasadmin.sdincident.sdSummary

    from KSB.BillableLineDetails

    LEFT JOIN kasadmin.sdincident

    ON left(KSB.BillableLineDetails.Description,8)=kasadmin.sdincident.ref

    where (KSB.BillableLineDetails.DetailTypeID=0 and LEN(KSB.BillableLineDetails.Description) = 9 and KSB.BillableLineDetails.Description like 'IN%')