Creating a Date

  • Thread starter Thread starter Phantom_guitarist
  • Start date Start date
P

Phantom_guitarist

I need to create a date from several columns in a table. ie one for the day,
one for the month and one for the year. The items are stored as numbers.
Can anyone help me.
 
I need to create a date from several columns in a table. ie one for the day,
one for the month and one for the year. The items are stored as numbers.
Can anyone help me.

DateSerial(yearnum, monthnum, daynum) does exactly this: e.g.

DateSerial(2003, 11, 2)

will return a Date/Time value #11/2/2003#.
 
Cheers, that worked excellent. What about if I wanted to combine a text
field and a number field.
eg.
Text field: phone calls
number field: 6

new field: phone calls (6)
 
You can concatenate fields in a query -- you may need to convert a numeric
field to a string with the CStr() function.

Perhaps something like (actual syntax may vary)

YourNewString: "Phone calls (" & CStr(Nz([phone calls],0)) & ")"

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top