operations on form entered control variables

yossarin

New member
Local time
Today, 07:20
Joined
Feb 19, 2009
Messages
3
Hi, I am using a form [data_collect] to collect the data on starting date in my database. The text box is named start_date and I use "short date" format for it. When I then run a query that for instance includes a column end_date: Forms![data_collect]![start-date] +5 the results are transformed into number format. If I use Format() function, the result is displayed as date, but is not recognised as date further on so I cant rely on it. Does anyone know how to address this problem? Thanks in advance
 
sorry for bumping old question:

Basically, I would like my query to display the date+[form entered parameter]+number.
If I wrote the following code into my query:
....
some_date: query.date +5
....
it returns the result in "date" format. (original date+ 5 days)
If instead I have the following code:
....
some_date: query.date+Forms![data_collect]![start-date] +5
.....
even though (Forms![data_collect]![start-date]) is in date format, the result is displayed (and recognised) as number only.
 
query.date+Forms![data_collect]![start-date] +5

well whats query.date?
adding a number to a date is still a date, so you must be "corrupting" this somehow
 
query.date (or table.date) is the original date that I want to modify. Imagine I have table which has 1 column (table.number) with a number and a second column (table.date) with date.

I want to create a simple forecast, by adding some fixed number to our number column, and updating date by adding 5 days.

When I just add a number (5) to the table.date, I get the result in date format.
When I add a form.date (from form), the result is displayed and recognised in number format (and simple change in formatting using "format" function wont help).
 

Users who are viewing this thread

Back
Top Bottom