|
-
Jan 18th, 2007, 06:10 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Jan 18th, 2007, 08:03 AM
#2
Thread Starter
Hyperactive Member
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:
Dim m_Start as date
Dim m_End as date
If Month(DateValue(dsRow.Item("StartDate"))) < Month(gDate) Then
m_Start =
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|