Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

ADS SQL statement to check in array 12 Sep 2021 10:16 #19568

  • ic2


  • Posts: 1075
  • In ADS I can select

    cQuery:="Select * from Mydbf d where d.somedate>='"+Date2SQLDate(dFrom)+"' AND d.somedate<='"+Date2SQLDate(dTo)+"' "
    cQuery+="AND d.relation='"+cRel+"' "

    in which case I get records within the given date range for this (1) relation (e.g. client) only.
    I however do have a selection of relation keys in an array aRelations. But this won't work as 2nd line:

    cQuery+="AND ascan(SELF:aRelations,d.relations)<>0"
    Is there a way to achieve that?

    Dick

    Please Log in or Create an account to join the conversation.

    ADS SQL statement to check in array 13 Sep 2021 05:06 #19577

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2726
  • Hi Dick,
    I would transform the content of self:aRelations to a SQL array and write:
    cQuery += " and d.relations in ( x, y, z, ... )"
    For such uses I have a function Array2SQLList().
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    ADS SQL statement to check in array 13 Sep 2021 11:31 #19582

    • ic2


  • Posts: 1075
  • Hello Wolfgang,

    Yes, that work, thanks a lot! I wasn't aware of SQL arrays until your reply.

    Dick

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1