|
|
creating a concatenated field
I would like to combine 3 fields with 3 different data types: string, date
and integer. I would like to combine them into a string. What do I need to
do to convert the datea nd integer values into strings in order to save the 3
together as a string field. I would like to do this with in the query.
Thanks!
|
|
0
|
|
|
|
Reply
|
Utf
|
4/2/2007 3:34:03 PM |
|
If you are using Access you should be able to use the "&" concatention
operator.
Field: Combined: StringField & DateField & integerField.
Are any of the fields ever Null? If so, what do you want to display for the
null values
Do you want specific formats for the date and integer fields? For example,
numbers should be five characters long with leading zeroes; dates should be
in the format "mm-dd-yyyy".
Do you want separators between the values in the sections?
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"querykitty" <querykitty@discussions.microsoft.com> wrote in message
news:ADE4FAC8-56F3-4F12-ADC7-24FA0253BD00@microsoft.com...
>I would like to combine 3 fields with 3 different data types: string, date
> and integer. I would like to combine them into a string. What do I need
> to
> do to convert the datea nd integer values into strings in order to save
> the 3
> together as a string field. I would like to do this with in the query.
>
> Thanks!
|
|
0
|
|
|
|
Reply
|
John
|
4/2/2007 4:23:45 PM
|
|
Replace(StringField," ","") & Format(DateField, "yyyymmdd") & IntegerField
Use the replace function to remove all spaces from the string field
Use the format function to return the date as a string in the specified
format
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"querykitty" <querykitty@discussions.microsoft.com> wrote in message
news:3C7D5478-D26C-437A-AA96-EA4782B5EE5F@microsoft.com...
>I want the date to just read as numbers such as 20070405 and all spaces to
>be
> taken out of the text field so I have one long string. It is going to be
> used as a reference key so each will be unique.
>
> Thanks for your assistance.
>
> "John Spencer" wrote:
>
>> If you are using Access you should be able to use the "&" concatention
>> operator.
>>
>> Field: Combined: StringField & DateField & integerField.
>>
>> Are any of the fields ever Null? If so, what do you want to display for
>> the
>> null values
>>
>> Do you want specific formats for the date and integer fields? For
>> example,
>> numbers should be five characters long with leading zeroes; dates should
>> be
>> in the format "mm-dd-yyyy".
>>
>> Do you want separators between the values in the sections?
>>
>>
>>
>> --
>> John Spencer
>> Access MVP 2002-2005, 2007
>> Center for Health Program Development and Management
>> University of Maryland Baltimore County
>> ..
>>
>> "querykitty" <querykitty@discussions.microsoft.com> wrote in message
>> news:ADE4FAC8-56F3-4F12-ADC7-24FA0253BD00@microsoft.com...
>> >I would like to combine 3 fields with 3 different data types: string,
>> >date
>> > and integer. I would like to combine them into a string. What do I
>> > need
>> > to
>> > do to convert the datea nd integer values into strings in order to save
>> > the 3
>> > together as a string field. I would like to do this with in the query.
>> >
>> > Thanks!
>>
>>
>>
|
|
0
|
|
|
|
Reply
|
John
|
4/5/2007 5:30:39 PM
|
|
|
2 Replies
300 Views
(page loaded in 0.029 seconds)
|
|
|
|
|
|
|
|
|