Add user input into query firld name

Fiasco

New member
Local time
Tomorrow, 06:56
Joined
May 11, 2007
Messages
6
Hi

Not sure if this can be done or not but I have a query where when it is run you are prompted to enter a date from. can the date entered then go into the field name.
for example the query is for sales from a certain date (user selected). Whne run you are requested to enter the from date [input from date], if currently the field name is "SalesFrom" can it be changed to "SalesFrom1/1/11" with 1/1/11 being the date which was entered when the query prompted for it.

Hope this makes sense, it is just something I have been mucking around with and dont wont to build a form.
 
Not while running a query but it can be done before running the query.

More important WHY?? You seem to have a date as a fieldname. Dates must be stored in a field not as part of a fieldname.

You need to rethink your database design.

What happens when you enter a date which is not in your database?
Then you have to add a new field with that name. This is unwanted behaviour in a database. You need to normalise it to the 3rd or BCNF normalform.
Check wikipedia about normalisation

HTH:D
 
Thanks Guus for your reply.

I dont need it for anything, I just was running an Ad-hoc query where it returns data with a date greater than whatever was needed.
Because the people who want the data are slow at getting back to me they may change the date from. I built the query for it to prompt for a date. That way I didnt need to hard code a date.
The query returns the data field name "salesDate". I was just wondering if I could add onto filed name the date I input into the prompt so when I send the data to our sales area they see I have run it from a certain date at the top of the column.

This is not required it was more just a question of can it be done only out of curiosity more than anything else.
 

Users who are viewing this thread

Back
Top Bottom