Results 1 to 2 of 2

Thread: [2005] Populate Date Field in Dataset

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [2005] Populate Date Field in Dataset

    Hello,

    I have a dataset that includes a couple of date fields (sDateFrom and sDateTo).
    Id like to change the value of sDate from depending on what date it is in the dataset - so If sDateFrom is last month or earlier then I'd like sDateFrom to be the first of this current month.

    For example :

    If sDateFrom in dataset = 12/12/2006 then I'd like to change it to 01/01/2007
    If sDateFrom in dataset = 07/01/2007 then I'd like to leave it as 07/01/2007

    How can I do this ?

    Thanks.
    Last edited by Jonny1409; Jan 18th, 2007 at 06:32 AM.

  2. #2

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: [2005] Populate Date Field in Dataset

    Ok - I've been looking at this some more and I think I'll have to declare some variables to be used for the start and end dates.

    I've done this and checked whether the month of the value in the dataset matches the month of the current date or not.

    However, I don't know how to populate the m_Start and m_End variables.

    ps - dsRow = Dataset Row , gDate = Today's Date
    VB Code:
    1. Dim m_Start as date
    2. Dim m_End as date
    3.  
    4. If Month(DateValue(dsRow.Item("StartDate"))) < Month(gDate) Then
    5. m_Start =
    6. m_End =

    Am I on the right track ?

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