"000" Not working

  • Thread starter Thread starter Gina Whipp
  • Start date Start date
G

Gina Whipp

Hi Guys,

I am not getting why I can't 3 0's to display. I get an error message
"Expecting End of Statement" while to trying to compile this code AND if I
leave 000 with nothing I get 1 0 and I need 3 to display in combination with
the CustomerID. Cananyone point me in the right direction?

DoCmd.RunSQL "INSERT INTO tblGetAUPReferenceID ( garCustomerID,
garAUPReferenceID )SELECT tblCustomerProfile.cpCustomerID, [cpCustomerID] &
"000" AS ID FROM tblCustomerProfile;"

Thanks,
Gina
 
Is it a number field? If so, then you will only see one 0. There is no
such NUMBER as 000. 0, 00, and 000 are all just ZERO. When you ask someone
for one dollar, you don't ask for "zero zero one dollar".

If you need to keep leading zeros you would have to make it a text field.

If your field is not a number filed, please ignore my rant :-)
 
Rick,

Yes it is a number field but I am tyring to force the 3 ending 0's because I
need it to display 50000. And unfortunately it has to stay a number field.
So I am guessing the only way to do this is to use an Append Query (which
does work fine)???

Thanks anyway, just trying to cut down on my queries...

Rick B said:
Is it a number field? If so, then you will only see one 0. There is no
such NUMBER as 000. 0, 00, and 000 are all just ZERO. When you ask
someone
for one dollar, you don't ask for "zero zero one dollar".

If you need to keep leading zeros you would have to make it a text field.

If your field is not a number filed, please ignore my rant :-)

--
Rick B



Gina Whipp said:
Hi Guys,

I am not getting why I can't 3 0's to display. I get an error message
"Expecting End of Statement" while to trying to compile this code AND if
I
leave 000 with nothing I get 1 0 and I need 3 to display in combination with
the CustomerID. Cananyone point me in the right direction?

DoCmd.RunSQL "INSERT INTO tblGetAUPReferenceID ( garCustomerID,
garAUPReferenceID )SELECT tblCustomerProfile.cpCustomerID, [cpCustomerID] &
"000" AS ID FROM tblCustomerProfile;"

Thanks,
Gina
 
Try:

DoCmd.RunSQL "INSERT INTO tblGetAUPReferenceID ( garCustomerID,
garAUPReferenceID ) SELECT tblCustomerProfile.cpCustomerID, [cpCustomerID] &
""000"" AS ID FROM tblCustomerProfile;"
 
Van,

Bowing head before the GREAT MASTER a BIG BIG THANKS


Van T. Dinh said:
Try:

DoCmd.RunSQL "INSERT INTO tblGetAUPReferenceID ( garCustomerID,
garAUPReferenceID ) SELECT tblCustomerProfile.cpCustomerID, [cpCustomerID]
&
""000"" AS ID FROM tblCustomerProfile;"

--
HTH
Van T. Dinh
MVP (Access)


Gina Whipp said:
Hi Guys,

I am not getting why I can't 3 0's to display. I get an error message
"Expecting End of Statement" while to trying to compile this code AND if
I
leave 000 with nothing I get 1 0 and I need 3 to display in combination with
the CustomerID. Cananyone point me in the right direction?

DoCmd.RunSQL "INSERT INTO tblGetAUPReferenceID ( garCustomerID,
garAUPReferenceID )SELECT tblCustomerProfile.cpCustomerID, [cpCustomerID] &
"000" AS ID FROM tblCustomerProfile;"

Thanks,
Gina
 
Back
Top