SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Nov 30, 2006, 08:37 #1
- Join Date
- Jul 2005
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Asp insert into access using double deletes beginning zeros
Hello,
I'm trying to input data into an access database using asp and I'm using double as the number field type in access. And whenever the number is inserted it is around 9 digits sometimes the number begins with 2 zeros but when inserted the beginning zeros are deleted.
How can I have the number inserted and keep the initial zeros?
Thanks,
James
-
Nov 30, 2006, 09:22 #2
- Join Date
- Nov 2001
- Location
- The Central Plains
- Posts
- 3,304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you can't with a double data type. you'll have to change the type to text...
-
Nov 30, 2006, 09:28 #3
- Join Date
- Jul 2005
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Will any of the other number fields retain the beginning zeros?
Thanks for your help,
James
-
Nov 30, 2006, 09:54 #4
- Join Date
- Nov 2001
- Location
- The Central Plains
- Posts
- 3,304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nope, since real numbers don't begin in zero. do you really need it as a double?
-
Nov 30, 2006, 10:08 #5
- Join Date
- Jul 2005
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No it doesn't really have to be a double I suppose. The only requirement was that it be 9 digits long that's why I made it a double.
Thanks,
James
-
Nov 30, 2006, 10:15 #6
- Join Date
- Jul 2005
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I talked to the client and text was acceptable so I just changing that particular field to a text field.
Thanks for your help,
James
-
Nov 30, 2006, 13:34 #7
- Join Date
- Nov 2001
- Location
- The Central Plains
- Posts
- 3,304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you can check the length of a string and make sure that is 9 characters long:
Code:if len(mystring)>9 then ' do something about end if
-
Nov 30, 2006, 13:39 #8
- Join Date
- Jul 2005
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for your help. Yes the data is being collected from a form and a javascript validation would probably be best.
Bookmarks