Results 1 to 3 of 3

Thread: Geting the correct Date

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    29

    Red face Geting the correct Date

    Hi,

    What is the correct syntax to add up the date??

    Example: Calculate the DueDate

    Transaction Date : 14/8/2004
    Days taken : 3 days
    DueDate : ??

    Please Help!!

    Thanks,
    Viv

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    If you need to add days, you can do something like
    VB Code:
    1. Dim today As Date = Now
    2.         today = today.AddDays(3)
    3.         MessageBox.Show(today)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    29
    Hi,

    I still can not get the DueDate, My DueDate should be TransDate(Date) + RentalPeriod(number of days).

    Heres part of my coding, i retrieved the TransDate and RentalPeriod from the SQL server. Then, i want to calculate the DueDate from TransDate + rentalPeriod. Then, i would like this calculated DueDate to display in the grid.
    How can i do that???

    Please help!!1


    cm.Connection = OleDbConnection1
    cm.CommandText = "Select VideoTitle, RentalPeriod, TransDate from TransDetails JOIN Transactions ON Transactions.TransNo = TransDetails.TransNo WHERE CustNo ='" & txtCustNo.Text & "'"

    [??I need to get the DueDate by TransDate + RentalPeriod???
    ??how to display this Duedate in the grid along with other data???]

    OleDbDataAdapter2.SelectCommand = cm
    OleDbDataAdapter2.Fill(objDsTesting, "VideoTitle")
    cm1 = Me.BindingContext(objDsTesting, "VideoTitle")
    ' txtCustNo.Text = ds.Tables("temp").Rows(cm1.Position)(0)

    grdTransDetails.SetDataBinding(objDsTesting, "VideoTitle")


    Thanks
    viv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width