Creating a Date

  • Thread starter Phantom_guitarist
  • 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.
 
J

John Vinson

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#.
 
P

Phantom_guitarist

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)
 
J

Jeff Boyce

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top