Sql Statement and datepicker..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Irda
    New Member
    • Aug 2008
    • 1

    Sql Statement and datepicker..

    i want to get the total amount of price from one of the column in a table.
    i've use datepicker for choose the date that i want to use for calculate the price

    this is the example of my coding.

    strSql = "SELECT Sum(DispAmt) As TotalDisposal from queAnaPro Where DispDate Between " & DateFrom.Value & " AND " & DateTo.Value & " "
    rec1.Open strSql, Con, adOpenStatic
    Text1.Text = FormatNumber(re c1!TotalDisposa l, 2)

    but, the amount that appear is for all the date. not the selected date from the date picker.
    beside that, the date format for date picker is mm/dd/yyyy
    how can i change the format to yyyy/mm/dd?

    hope anybody can help me..thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    you need to set the custom format property and conveert the string to date before passing to database.

    Comment

    Working...