Information générale
Catégorie:
Gestionnaire d'écran & Écrans
> I have a large DB that and 2 of its fields are labled zip and zip2. The
> zip field contains the first 3 #'s of the zip and the zip2 column
> contains the last 2 #'s. How can I combine the two fields into one that
> has a 5 number zip?
Two ways that I know work.
1) make one of the fileds bigger.
then do a golbal replace
use xxx
go top
replace zip with alltrim(zip) + alltrim(zip2)
if they are Number files then
replace zip with val( alltrim( str( zip )) + alltrim( str(zip2))
)
this will conver the the first field to a string and then convert
the 2nd field to a string
tatke the combined string and convert it back to anumber!
2) create a NEW field and do the sam as above, then delete the two old
fileds!
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement