var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to use answer from date prompt in calculated field...
I want to write a query on a warranty database to figure out how many days are left on a unit's warranty based on a future date.
For example, if a unit shipped on 1/1/04 and the warranty is 365 days, how many days are left on the warranty as of 3/31/04?
I want to prompt the user for the date to compare to,
then use that date to calculate how many days are left.
I got it to work just comparing to today's date(DATE()), but I can't get it to work using the prompted date field. So I have the calculated fields:
DATE PROMPT: [CDate()]
DAYS LEFT: [WARRANTY END DATE]-[DATE PROMPT]
IN OR OUT: IIf([DAYS LEFT]>0,"IN","OUT"
I do get prompted for the date, but the when the query runs I get ERROR for the DAYS LEFT and IN OR OUT fields.
I guess I am not using the right syntax to be able to use the answer from the date prompted.
Any help is appreciated greatly!
if you are using input boxes to prompt for the date, then try this:
Dim date_prompt as string
Dim days_left as string
date_prompt = InputBox(your_Prompt, your_Title)
days_left = [WARRANTY END DATE]-date_prompt
[textbox] = IIf(days_left>0,"IN","OUT")
where [textbox] is the place where u want to show a "IN" or "OUT".
inform me if it works.