View Full Version : Setting the Data type without data


gblack
02-25-2009, 06:14 AM
OK here's my plight,

I have a query that puts together various fields from different tables. What I want to do eventually is turn that into a table (i.e. using a make table query).

Unfortunately the query is missing a few fields that need to be in the table for use at a later time. These fields happen to be date fields.
I can create a special field named Project_End_Date, but I don’t have a value for the date field yet and I don’t want to fill this with dummy information (e.g. Project_End_Date : #1/1/2109#, or the like).

My question is: Is there any way to force the data type for a special field in a query (in this case a “Date field”) without actually having a “Date” value in said field?

Obviously there are ways around this: I could add a bogus date value, create the table, then delete all the bogus values after the fact… etc… but I wanted to know if there was a cleaner way to do this, maybe with a setting or function I don’t know about, or possibly a homemade function that one of you big brained folks made whilst dealing with the same issue?

Thanks,
-Gary

Guus2005
02-25-2009, 10:29 PM
Create your table and leave out the two empty date fields.
Add them later on using an ALTER TABLE query.

HTH:D

HiTechCoach
02-25-2009, 10:44 PM
OK here's my plight,

I have a query that puts together various fields from different tables. What I want to do eventually is turn that into a table (i.e. using a make table query).

Unfortunately the query is missing a few fields that need to be in the table for use at a later time. These fields happen to be date fields.
I can create a special field named Project_End_Date, but I don’t have a value for the date field yet and I don’t want to fill this with dummy information (e.g. Project_End_Date : #1/1/2109#, or the like).

My question is: Is there any way to force the data type for a special field in a query (in this case a “Date field”) without actually having a “Date” value in said field?

Obviously there are ways around this: I could add a bogus date value, create the table, then delete all the bogus values after the fact… etc… but I wanted to know if there was a cleaner way to do this, maybe with a setting or function I don’t know about, or possibly a homemade function that one of you big brained folks made whilst dealing with the same issue?

Thanks,
-Gary


I rarely use make table queries. I find it better to create the table with the desired design. You can manually create the table or you could write some VBA code to create the table.

Instead of running a make-table query, I use a delete query followed by an append query.