Adding Days To Todays Date
I want to add x amount of days to todays date. The number of days is held in an integer variable...how would i do it????
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Q.1 - Adding Todays Date To The Write File When Saving And Q.2 - Appending
I would like to know if I could add a statement to the write command somewhere in the following code, so the file would write Todays date at the end in date format MM/DD/YY:
As the text in my write file looks like this:
"Flower - Lilac",2,5.22,10.44
Could I get it to add TODAYS date automatically to read
"Flower - Lilac",2,5.22,10.44,03/07/04
My code now reads:
**************************************************
Private Sub cmdWriteQuotation_Click()
Dim pintCurrentItem As Integer
Dim pstrFileName As String
Dim psngTotal As Single
pstrFileName = _
InputBox("Enter the filename", "Write File")
If pstrFileName <> vbNullString Then
Open pstrFileName For Output As #1
For pintCurrentItem = 0 To _
lstQuotedExtPrice.ListCount - 1
Write #1, _
lstQuotedProduct.List(pintCurrentItem), _
Val(lstQuotedQty.List(pintCurrentItem)), _
Val(lstQuotedPrice.List(pintCurrentItem)), _
Val(lstQuotedExtPrice.List(pintCurrentItem))
Next
psngTotal = 0
For pintCurrentItem = 0 To _
lstQuotedExtPrice.ListCount - 1
psngTotal = psngTotal + _
lstQuotedExtPrice.List(pintCurrentItem) * 1.06
' Above line computes Sales Tax directly into total
Next
txtTotal.Caption = Format(psngTotal, "Currency")
End If
Close #1
End Sub
****************************************************
Also, when I pull this data into an Access Table it leaves the .44 off the total price of 10.44 as from the line below: why?
"Flower - Lilac",2,5.22,10.44 (It pulls the 5.22 just fine, but the 10.44 it gives me 10)
Also someone told me how to append the write file here earlier by using the Append command with the For statement, but can't get that to work...could someone give me a clue how to change this Statement to append all new input to the same text file.
My existing code is above and if you can show me how to use the append command I'd sure appreciate this too...
Thank you
NMP
Working Out A Date By Adding Days To Another Date
hi,
I have a date and number of days.
I'm trying to work out the date that comes out of adding the days to the original date (bringing into account months and end of year etc.)
would simply adding the days to the date do the trick (Date = MyDate + Days) ?
thanx
Adding Days To A Date?
I have a date in a field that is adate field and i wish to add a certain number
of days to it based on a day number in another field.
the first date is stored in D14 and the number of days to be added is in E14 and the output date should be in F14
This SHOULD work. "=D13+E13" because in the help file they do the exact same thing! but it doesnt work, why!
Adding Days To A Date
I already know of the datediff() function, which has helped me in the program thus far. I'm wandering how (to easily) to add basically two weeks to a date.
My program is set up basically so you cant really do anything until you enter the starting date of two weeks. Its for calculating how many hours you've worked in the two week pay period. I'm trying to auto fill the boxes with the date at least so all they have to do is enter the time.
I want to figure this part out because if they enter say 03/20/08 and it adds 14, currently it does not know that a new month will begin before this two week period ends. I could probably figure it out with a bunch of loops or case statements but I'm just wandering if there's like an opposite function to datediff. OR if theres a function OF datediff that i have not recognized yet that will do this. I use it to calc the seconds right now between the two dates and get my info from there... i haven't tried much else...
any thoughts or tips you experts could give me?
Adding Days To Date String
I have a feeling there is no easy answer for this one..
Does anyone know of a way to add days onto a date string such as "7/22/2006", making it "7/24/2006". This needs to be done within the code and in the above format.
Any help with this would be appreciated. I've spent all evening trying to find a way.
How To Resolve Adding Number Of Days To Date?
Hi, I am new here. I have this problem which I had go up for 2 days trying to solve it but it seems out of my ability since I am still a novic in vb and all I could do it stare at it with no output.
Example: I need a Return Date for a Holiday package. The return date must display automatically based on the Travel Date we type in one of the txt bar and the number of days of the holiday duration we type in another txt bar.
What I should get is: Return Date = Travel Date + No of Days of duration
23/05/04 = 23/05/04 + 2
I know I should have:
Dim Return Date As Date
Dim Travel Date As Date
but when it comes to the number of day of the holiday duration it seems I could not put it Dim to Date. But if I Dim the holiday duration to String then I get error. And if it is to be add then how am I to do when the Date is 31/05/2004 and by adding of 3 days will be automatically change to 3/06/2004? I mean the part on the month and year, how to make it to that it auto adds up the month and the year in accodrance to the days?
I know I am sounding confusing but how am I suppose to solve this? Can someone give me a clue? Or example will be most appreaciate. Thanks.
Bernhardt
Adding 2 Days To Date Time String
Is there an easy way to add 2 days to the datetime string that I'm using below?
Code:Dim CurrentTime As String = Format(Now, "yyyyMMddHHmmss")
Checking For Date In Access File And Compairing It To Todays Date...
Hey all, i am stuck at this point in my program.
I need the program to load up my access table and check for the date of orders:
each record has a field called PickUp and its formatted like "sat 1/1/2004".
When the form loads up, i need it to check that field and the computers date and if its the same, place the record into the list view. Keep going down the list til EOF.
Any help would be great.
Thanks for your time,
David
Still Having Probs With Select Statement Where Date = Todays Date
Hi Guys
I am using vb6.0 connecting to a SQL database (runningMSDE)
I am trying to load all contacts where the recontactdate is today
I have tried the following but am getting the error - syntax error converting datetime to character string - please help!
my code -
onload - dtpicker1.value = date
(tblcontacts.dtmrecontactdate is date/time)
Set adoduecallbacks = New Recordset
adoduecallbacks.Open "Select * from tblcontacts where dtmrecontactdate = ' " & DTPicker1.Value & "%" & " ' ", db, adOpenStatic, adLockOptimistic
- Please help!!!
Thanks
Problem With SQL Date Query (Todays Date)
Hi there,
Having a problem getting an SQL query to work when searching a database for todays date (basically a reminder package).
Here's the query
Set MyRecSet = MyConn.Execute("SELECT CoxRef, CompanyName, ContactName, postcode, tel FROM Reminders WHERE ReminderDate = #(date)# ")
Have tried all sorts of different things such as '&(date)&'") etc.
Only works when I type the date in like so .. WHERE ReminderDate = 15/02/2005
Any ideas please ?
Seymour
Compair Todays Date To A Date On File
Code:
Public Sub CheckExpire()
sb.Panels(1).Text = "Checking For Expired Membership!"
Dim B
Dim A
B = 1
A = 1
Do
If sb.Panels(2).Text = list.TextMatrix(B, 5) Or sb.Panels(2).Text > list.TextMatrix(B, 5) Then
If list.TextMatrix(B, 1) = "" Then
Exit Do
Else
Form2.Show
Form2.list.TextMatrix(A, 1) = list.TextMatrix(B, 1)
Form2.list.TextMatrix(A, 2) = list.TextMatrix(B, 2)
Form2.list.TextMatrix(A, 3) = list.TextMatrix(B, 3)
Form2.list.TextMatrix(A, 4) = list.TextMatrix(B, 4)
Form2.list.TextMatrix(A, 5) = list.TextMatrix(B, 5)
Form2.list.TextMatrix(A, 6) = list.TextMatrix(B, 6)
B = B + 1
A= A + 1
End If
Else
B = B + 1
End If
Loop
A = A - 1
sb.Panels(1).Text = "Check Complete, " & A & " Found To Be Expired!"
End Sub
Humm? 0 Found, I Added 1 With A Expired Date, Ideas?
Edited by - catacomb on 8/29/2003 11:00:16 AM
Go To Todays Date Row
Hi-
I was wondering if anyone could help me write a macro that when clicked on would take the user to todays date.
My spreadsheet is set up with every date from now until 2010 on the left column.
I want a feature where you click on a button an it takes you to (maybe even highlights that row) the current date.
Any help would be appreciated. I have never used VB or macros before.
thx
matt
Todays Date
is there a way to have a caption display todays date?
How Do I Insert Todays Date Using Sql
I have an access table and I want to insert today's date into one of the field. What is the correct syntax.
This is not working:
Dim todaysdate as String
todaysdate = format(Now,"m/d/yy")
Insert into table(Date)Values(todaysdate)
Thanks
List ALL Files For Todays Date
Hi,
Can someone please help me with the following request.
I wish to list all file names on my hard disk that have a last accessed/modified date of today - this includes all subdirectories
from the root directory.
Thanking you in advance.
Cheers,
Kevin
Saving Textbox With Todays Date
I am trying to save the text in a textbox with the with the current date automatically updated every day by simply clicking a button
This is what I have but it doesnt work
visual basic code:--------------------------------------------------------------------------------Public Function SaveText(Text1 As TextBox) As Boolean
Dim hFile As Integer
Dim sFileName As String
On Error Resume Next
hFile = FreeFile
sFileName = App.Path & "C:" & Format(Now, "yyyymmdd") & ".txt"
Open sFileName For Output As #hFile
Print #hFile, Text1.Text
Close #hFile
End Function
Private Sub Command1_Click()
Call SaveText(Text1)
End Sub
Private Sub Text1_Change()
End Sub
--------------------------------------------------------------------------------
Inserting Todays Date With Button
I am v new to this VBA lark so be kind :-)
I have three cbo's - dd, mm, yyyy and what I want is a button next to the date dropdowns so you can click 'today' and it fills out the dd/mm/yyyy with todays dates.
I currently have this cbo code :-
With cbodd
.AddItem "01"
.............
.AddItem "31"
End With
With cbomm
.AddItem "January"
.............
.AddItem "December"
End With
With cboyyyy
.AddItem "2004"
.............
.AddItem "2008"
End With
Any help/pointers very welcome!
Thanks
Pete
Edited by - petebrooker on 6/22/2004 10:10:00 AM
Saving Text With Todays Date
I am trying to save the text in a text box as for example "20050511.txt" for todays date. I want the date to update automatically and I want the file to save when I click a command button.
Please help if you can
Reading Todays Date / Display Data
I'm writing a small address program and wish that it will display a list of birthdays/anniversaries that are happening 'today' when the form loads.
As I have the control version of VB I am unable to read from a database, so I thought that I would just list them - but can I get VB to read a list and recognise 'todays' date?
A direct to research would be helpful, Cheers
FIXED!!! Display Todays Date <Access>
< edit > I got it working...
How do assign today's date to a text box? I tried searching around here before posting a simple question.
Here is what I have:
Code:
Private Sub order_date_BeforeUpdate(Cancel As Integer)
order_date.Value = Date
End Sub
Edited by - SubPar_Coder on 9/15/2004 3:00:46 PM
Monthview DayBold Works, But Resets To Todays Date.
This is a pretty easy task I think, but I wanted to run this by everyone on the forum.
My program revolves around a monthview control. The user clicks the date they want to work with and off they go. What I'd like to do is have the monthview control show the days in bold where data has been entered into the database. That way the user can see at a glance (one month at a time) where they've entered data.
I think the easiest way to do this is to find the first and last day of the month their working in then run a query that selects distinct dates from the database where they fall in between the first and last days of the month. At that point I can loop through and say if there is a match, bold the day...if not, move to the next day.
So I guess all I need is how to find the first and last days of a month based on where the user is currently sitting in the monthview control.
Date Format, Count No. Of Days & Highlight Date In Calendar
<html><div style='background-color:'><DIV>
<P>Hi all,</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Happen to visit this website accidentally and found that it’s very useful to VB beginner like me. <SPAN style="mso-spacerun: yes"> </SPAN>I have the following problems and would appreciate your kind assistance to enlighten me.<SPAN style="mso-spacerun: yes"> </SPAN>Attached is my file for your checking.<SPAN style="mso-spacerun: yes"> </SPAN></P></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <?XML:NAMESPACE PREFIX = O /><O:P></O:P></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; tab-stops: list .5in; mso-list: l0 level1 lfo3">1)<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN>Sometimes, the number of days is incorrect with a big figure (e.g from 1 to 30 Apr) or even a negative figure after I change the system’s date format from “mm/dd/yyyy” to “dd/mm/yyyy”.<SPAN style="mso-spacerun: yes"> </SPAN></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in"> <O:P></O:P></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; tab-stops: list .5in; mso-list: l0 level1 lfo3">2)<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN>In calculating the number of days, I need to exclude Sunday.<SPAN style="mso-spacerun: yes"> </SPAN>By using the “WeekDay (Calendar1) = 7 “ method, I still didn’t get the correct result.<SPAN style="mso-spacerun: yes"> </SPAN></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> </P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><O:P> 3) How to highlight a certain date in calendar with different colour to indicate it's a public holiday ? </O:P></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><O:P></O:P> </P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Many thanks in advance.<SPAN style="mso-spacerun: yes"> </SPAN></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <O:P></O:P></P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">Best regards,</P>
<DIV></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">YC </P>
<DIV></DIV>
<DIV></DIV>
<P><BR><BR></P>
<DIV></DIV>
<DIV></DIV></div><br clear=all><hr>Add photos to your e-mail with <a href="http://g.msn.com/8HMVEN/2746">MSN 8.</a> Get 2 months FREE*.</html>
Using The DATE To Transmit 2 Days Ahead Of Current Date (RESOLVED Thank You)
It seems simple, ive looked and looked, cannot find it. . .
basically what I need to do is transmit 2 days ahead of current date. . .
IE today is the 14th, I need it to auto transmit it to the 16th.
Its a pend out date on an account, I've got everything auto except for this feature. . . .
If I get in touch with a client, I want the account to automatically pend the account out for 2 days.
Thanks for the help, love the site, look for me more often, and be sure to purchase some of my award winning albums at a christian store near you.
Edited by - Bryan Duncan on 6/15/2004 3:52:58 PM
Check If Today's Date Is X Days Past Another Date
Hi, I am using Visual Basic 6.0 on Win 2000 environment. I am currently developing a video rental app as a school project. How can I check and see how many days past today's date is from a previously entered date?
For instance, 1- When a customer rents and item, I enter the customer's rental date (let's use 5/20/04 as an example), 2 - Then when the customer returns the item, I enter in the date returned (5/23 - today's date). How can I code this in VB to check for how many days late the item is?
I tried doing this, but nothing happens: (let's assume the variable dateRented is the date that was previously entered when the customer rented the item)
VB Code:
Dim todaysDate As DatetodaysDate = Now If dateRented > todaysDate Then MsgBox "This item is late!"End If
Any suggestions would be great. I appreciate it!
Date Function Minus Days From Date
I think the title says it all but I just want to minus daysTillLastSat from the date so that I can find out what the date of last Saturday was from any specific point in time and space well time mainly. Any ideas?
Code:
Function weekMaker() As Integer
For i = 1 To WeekDay(Now())
daysTillLastSat = daysTillLastSat - 1
Next i
If daysTillLastSat = -7 Then
daysTillLastSat = 0
End If
MsgBox "DAYS BACK TILL SAT + " & daysTillLastSat
MsgBox Now() - WeekDay(daysTillLastSat)
End Function
Start Date + End Date = Amount Of Days
Hi Guys
I have a simple question that i cant quite figure out, what i have is.
3 text boxes namley "Text2" "Text3" and "Text4" Text2 gets a start date say
01/10/2005 and text3 an end date say 30/10/2005 then in Text4 the amount of days displayed is 30. I just dont know how to get the 30 displayed in Text4.
It should be pritty easy but i have hit a blank, please help.
kind regards
Adding Only Certain Days
HI again
pls look at my sample data each column is has a day of the week I need to add each ROW (for example) A1 to to last column with data -1 with the answer displayed in A cell last column with data +1
thanks
Adding No. Of Days To A Textbox
Hi,
I am having trouble with the following. I have in text1.text a date ie.. 1/1/2004 and I want to show in text2.text a date say 11 days later ie.. 12/1/2004.
I tried text2.text = text1.text + 11 and the result is blank. any ideas?
Regards
David
Add Days To A Date
I have an application which the current date is displayed. I need to add 21 days to that current date. How is this done?
Judy
I Want The Date Of Some Days Ago...
Hi all.
i need something that give me the date of 5 days ago or 1 week...
there is some function like Datediff known for do this automatically?
example
now is 10/2/2003
i want another date automatically calculated 5/2/2003
thnk you all!!!!
Date {add Days To}
hi i was wondering if any1 can help me with this as i had many attempts my self
i have a txt box called txtdate = the user inputs any date i.e 04/03/05
i then have another txt box called txtdays = user inputs no. of. days the book is rented out for
finally i have a box called txtreturn = this box displays when the books is due back after da cmdcalculate button is clicked on.
basically the user inputs a date in2 txtdate and a number in txtdays, user then clicks on cmdcalculate n the retturn date is shown in txtreturn.
can any1 help me with this thanks
30 Days After A Given Date?
how can i make a textbox with a date eg. 8/11/02 tell me if it is 30 days after that date using the computers clock?
any suggestions?
How Do I Add 7 Days To A Date?
Hello. I'm writing a program to simplify my business. Basically, you choose what you want to send-
1)letter to prospect concerning their resume
2)letter to prospect telling them when training meeting is
3)letter to prospect confirming their reservation
4)letter to city leader confirming prospect's reservation
Everything is pretty automatic, and for good reason. When this is finished, I'm distributing it to all representatives in the company.
I have them enter the meeting date as follows:
month (MM) in txtMeeting1
day (DD) in txtMeeting2
year (YY) in txtMeeting3
Then, it prints the date of the meeting in the letter to the prospect/city leader, plus the date of next week's meeting. I don't know how to accomplish the latter. Could someone please help me out? How do I take the date I enter and make another date that's exactly 7 days after that? I'm totally lost
Thanks
BLiNDPiG
How To Add Days In A Date?
i have begindate.text and enddate.text
begindate.text = 05/02/06
enddate.text = 180 'days
sample output is: 10/29/06
what function should i used to comeup with the output.
thanks in advance...
Date Plus X Days
I would like to add x number of days to today or a variable date, can you advise on the best way of acheiving this
Many Thanks
Bobby123
How To Add Days To A Date
Hey!
I have a project in which the user chooses the number of days they wish to hire an instrument. On the receipt form i would like the date the intrument is to be returned to be displayed. However, i do not know the code to have the computer add X number of days to the date of hire.
Any help would be greatly appreciated.
ACHERON
How To Add Days In Date??
Hi
I have table in access2000 having field date. I want to add days in existing date and want to get new date. How to do this???
Pratik mehta
Add Days To Date
Hi Codeguru friends,
I´m a prommager from Chile. I would like to know if you have some code that add days to one date..something like this :
fin.Text = 21/5/2001 + 30 ' Days
fin.Text = 21/5/2001 + 90 ' Days
fin.Text = 21/5/2001 + 180 ' Days
fin.Text = 21/5/2001 + 360 ' Days
But I lost it, Could you help me please ?
It looks something like this:
"fin.Text = CStr(START.Text + Text1.Text) ?"
"fin.Text = CCur(START.Text) + CCur(Text1.Text) ?"
It was a good code for the job I want to do.
I hope you can help me.
Best Regads,
Patrick
Adding Days, Weeks, Years To Dates!
i need a function which would allow me, to add a specified number of days, weeks, years to a given date
lets say the date is text1
and i want to add two weeks to text1.
how can this be done plz?
Adding Xx Amount Of Days Before Preforming A Task.
Ok i need to do this, (For more information on what i want to make look at my previous post here)
http://www.vbforums.com/showthread.p...61#post2873161
OK what i need to do, i have an access database with some Domain in, and i want to call the domain into a vb application and then check the whois on this domain. But before this i want to know when the domain drops, e.g. i think its every 99 days, so lets take a domain which drops on 'Renewal date: 02-Feb-2007' i want to add 99 days onto this, and on the 99th day i want to call the domain into the vb application.
Note i want to call the domain on the 99th day of its renewal and now on the 99th day of input into the system. So i would need to do a whois secrch on the domain and lookup the renew date.
------------------------I will make this when we are at this section-------
When this is done and successful i want to then send multiply whois checks to a whois database looking for 'Registered' and 'Available' if its registered i want to keep trying (Sending the whois lookups to the system) and then when its available i want to then register the domain
Adding Events On Specified Days Over Weekly Period
The following code allows users to enter reoccuring events into my calendar on either specified days or weekdays only.
<%
Function tfld( name )
tfld = "'" & Replace( Request.Form(name), "'", "''" ) & "',"
End Function
Sub InsertRecord
Set calConn = Server.CreateObject("ADODB.Connection")
calConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & Server.MapPath ("/calendar/calendar_database/calendar.mdb") & ";"
calConn.Open
DIM inter_count, NewDate, calConn, baseSQL, SQL, daily, DateFinish, weekly
' all the SQL is the same for each record *except* the
' "event_date" field. And conveniently, it is the last field!
'
' So we set up all the SQL except the value of event_date ahead of time:
'
baseSQL ="INSERT INTO advevents " _
& "(event_title, event_teams, event_hostedby, " _
& "event_providername, event_provideradd, event_providerphone, " _
& "event_provideremail, event_providercontact, event_other, " _
& "event_type, event_members, event_cost, event_payment, " _
& "event_paymentto, event_paymentphone, event_meeting_class, " _
& "branch_location_name, event_additional, event_venue, " _
& "event_venue_location, start_hour, start_minute, start_ampm, " _
& "finish_hour, finish_minute, finish_ampm, event_description, " _
& "contact_person, contact_number, contact_email, other_location, " _
& "other_address, other_suburb, other_postcode, " _
& "other_phone, event_date) " _
& " Values (" _
& tfld("event_title") _
& tfld("teams") _
& tfld("hostedby") _
& tfld("providername") _
& tfld("provideradd") _
& tfld("providerphone") _
& tfld("provideremail") _
& tfld("contactperson") _
& tfld("other_type") _
& tfld("class") _
& tfld("members") _
& tfld("cost") _
& tfld("payment") _
& tfld("paymentto") _
& tfld("paymentphone") _
& tfld("meeting_class") _
& tfld("branch") _
& tfld("additional") _
& tfld("location_select") _
& tfld("sublocation_select") _
& tfld("starthour") _
& tfld("startminute") _
& tfld("startampm") _
& tfld("finishhour") _
& tfld("finishminute") _
& tfld("finishampm") _
& tfld("notes") _
& tfld("addedby") _
& tfld("phone") _
& tfld("email") _
& tfld("other_location") _
& tfld("other_address") _
& tfld("other_suburb") _
& tfld("other_postcode") _
& tfld("other_phone")
select case request.form("reoccurance")
case 1
NewDate = CDate( request.form("date1") )
DateFinish = CDate( request.form("date2") )
daily = ( CINT(request.form("option")) = 1 )
If daily Then
inter_count = 1
Else
inter_count = CINT( request.form("daily") )
End If
Do Until NewDate > DateFinish
If ( Not daily ) OR ( Weekday(NewDate) <> 1 AND Weekday(NewDate) <> 7 ) then
SQL = baseSQL & "'" & NewDate & "' )"
Calconn.execute(SQL)
End If
NewDate = DateAdd("d", inter_count, CDate(NewDate))
Loop
This adds 'daily' reoccurances, and works well as I have tested it with no problems.
Its this section here that handles 'weeklys' where im a little lost. What im allowing is, users on the previous form to select event reoccurs every 'x' number of weeks over a given period on monday, tuesday, wednesday, thursday, friday, saturday, sunday.
Eg. Event starts on April 2 and finishes on December 11. The event happens every 2nd week on Mondays and Fridays only.
How is it possible to identify the days of which they have selected. The users make these selection with a simple checkbox which sets thier values to '1'
So if a user selects that an event reoccurs mondays only monday would = 1.
case 2
NewDate = CDate( request.form("date1") )
DateFinish = CDate( request.form("date2") )
monday = request.form("monday")
tuesday = request.form("tuesday")
wednesday = request.form("wednesday")
thursday = request.form("thursday")
friday = request.form("friday")
saturday = request.form("saturday")
sunday = request.form("sunday")
weekly = ( CINT(request.form("weekly")) * 7 )
inter_count = weekly
Do Until NewDate > DateFinish
**************SOMEHOW IDENTIFY THE DATES/DAYS HERE?********
SQL = baseSQL & "'" & NewDate & "' )"
Calconn.execute(SQL)
NewDate = DateAdd("d", inter_count, CDate(NewDate))
Loop
end select
'done!
Calconn.Close
Set Calconn = Nothing
response.redirect("../events/thankyou.asp")
End Sub
%>
Any suggestions?
Subtracting The Days From A Date..
I Have my "first" project in the works... I'm doing a employee weekly time sheet.. To be used by the formen in the field on the jobs..What I want the user to do is when they enter the weekending date on the form when that loses the focus it puts the date in this format, mm/dd in the column over each day of the week.. Ex: If I put the weekending date at the top of my form .. 06/22/2003 then on Monday the begining of the week it would be:
__Mon __Tues __Wed___Thu etc.. etc.. up to Sun (Weekending)
06/16 __06/17__06/18__06/19 etc..etc..
The days are already in their own columns.. We just want this date format to be automatically put in underneath the days as soon as the Week Ending text box loses its focus... I can't figure this one out as of yet.. I'm still to green..
|