Forums
This topic is locked
does anyone know how to do this:
Posted 19 Nov 2002 22:49:01
1
has voted
19 Nov 2002 22:49:01 Adam Hussain posted:
I have 3 fields:Field 1: Initial Date
Field 2: Counter in days
Field 3: The output date
I want to do this:
When a user enters the initial date, say 31/05/2003, then enters field 2 the counter in days, lets assume the user enters the number 10, I want the output date to be 10 days away from the initial date. So the output date in this case would be: 10/06/2003.
I'm not good at coding so that may be a problem. I am also using Access as my DB.
If you can help I would be happy to return the favour.
Replies
Replied 20 Nov 2002 01:10:50
20 Nov 2002 01:10:50 Owen Eastwick replied:
Something like:
<%
varInitialDate = Request("txtInitialDate"
varDayCount = Request("txtDayCount"
varOutputDate = DateAdd("d", varDayCount, varInitialDate)
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Edited by - oeastwick on 20 Nov 2002 01:12:30
<%
varInitialDate = Request("txtInitialDate"

varDayCount = Request("txtDayCount"

varOutputDate = DateAdd("d", varDayCount, varInitialDate)
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Edited by - oeastwick on 20 Nov 2002 01:12:30
Replied 21 Nov 2002 11:15:49
21 Nov 2002 11:15:49 Adam Hussain replied:
Sorry I'm still a little uncertain here. I want to extract the details from my database and display those results.
So after a user inserts the details for field 1 and 2, I want it to display field 3.
I hope what I am saying is clear because English is not my first language and it can always be a set back when you have to explain something to someone.
So after a user inserts the details for field 1 and 2, I want it to display field 3.
I hope what I am saying is clear because English is not my first language and it can always be a set back when you have to explain something to someone.
Replied 21 Nov 2002 13:45:52
21 Nov 2002 13:45:52 Owen Eastwick replied:
Well, now that the calculation has been done you can use the result as a parameter in the SELECT statement to produce a recordset fom the database.
<%
varInitialDate = Request("txtInitialDate"
varDayCount = Request("txtDayCount"
varOutputDate = DateAdd("d", varDayCount, varInitialDate)
%>
Then set up the recordset with a run-time value of varOutputDate or modify the recordset code directly in code view something like:
RECORDSET CODE
RecordsetName.Souce = "SELECT Whatever, WhateverElse FROM TableName WHERE DateField = " & varOutputDate
RECORDSET CODE
RECORDSET CODE
RECORDSET CODE
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<%
varInitialDate = Request("txtInitialDate"

varDayCount = Request("txtDayCount"

varOutputDate = DateAdd("d", varDayCount, varInitialDate)
%>
Then set up the recordset with a run-time value of varOutputDate or modify the recordset code directly in code view something like:
RECORDSET CODE
RecordsetName.Souce = "SELECT Whatever, WhateverElse FROM TableName WHERE DateField = " & varOutputDate
RECORDSET CODE
RECORDSET CODE
RECORDSET CODE
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo