Is my sql commands correct

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RhazeMondragon
    New Member
    • Oct 2007
    • 10

    Is my sql commands correct

    "Select F_Empl_Code, Supply_Date, Sum(Supp_Total) , Min(Supp_Balanc e) from Tbl_Supply_Tran saction Where Supply_Date between '" & txtDate1.Text & "' and '" & txtDate2.Text & "' GROUP BY F_Empl_Code, Supply_Date

    this is my syntax.. but it cause error,, help me pls.... thanks!!!!!!
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What error do you get?

    Perhaps you have the wrong delimiters around your date values, as mentioned in the other thread.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Kindly post the exact error message.

      I think you need to format the date to the realated database date format.

      Comment

      • 9815402440
        New Member
        • Oct 2007
        • 180

        #4
        Hi.
        Use # as delimiter for date values.
        Your query should look like:
        "Select F_Empl_Code, Supply_Date, Sum(Supp_Total) , Min(Supp_Balanc e) from Tbl_Supply_Tran saction Where Supply_Date between #" & txtDate1.Text & "# and #" & txtDate2.Text & "# GROUP BY F_Empl_Code, Supply_Date"

        Regards,
        manpreet singh dhillon hoshiarpur
        Last edited by Killer42; Oct 29 '07, 01:40 AM. Reason: Added closing quotes

        Comment

        Working...