473,508 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is it possible to split up a number in one field into 2 new fields?

DJRhino1175
221 New Member
In a table I have a field labeled LotNo which contains a number, only it's a date+shift and looks like this "0104191", I'm being asked to make a report that is grouped by shift. Is there a way to split this number into Date "01/04/19" and shift (1, 2, or 3) using a query?
Nov 27 '19 #1
3 1618
Seth Schrock
2,965 Recognized Expert Specialist
If your number does actually does start with a 0, then your number is stored as text. This makes it easy to split up the different parts. The Left() function allows you to specify how many characters you want from the left side of the string. The Right() function allows you specify how many characters you want from the right side. For example, Right(LotNo, 1) will get you the shift. I'd put it in a query and then base your report off the query. It makes it a little more straight forward to then group your report on the field.
Nov 27 '19 #2
NeoPa
32,557 Recognized Expert Moderator MVP
Hi DJ.

I suspect you're now at the stage where understanding the difference between a number, on the one hand, and a string value that simply contains only digits, on the other, is quite important.

When communicating with others, as is common and necessary when asking for help on a subject, it is very important that you learn and use terminology that expresses your situation reliably and accurately. You will obviously benefit from that as experts will find it easier to answer your questions.

In this case Seth has spotted your error and given a full answer that is correct, but you can't always rely on that. Often the clues that Seth spotted just aren't there and we're left giving advice that's inappropriate and would obviously not work.

It's all part of the learning process you're on but I would say you should be thinking of getting on top of that at this stage.

All the best -Ade.
Nov 28 '19 #3
cactusdata
214 Recognized Expert New Member
Yes, split it into its parts:

Expand|Select|Wrap|Line Numbers
  1. Code = "0104191"
  2.  
  3. ShiftDate = DateSerial(Mid(Code, 5, 2), Mid(Code, 1, 2), Mid(Code, 3, 2))
  4. Shift = Val(Right(Code, 1))
Nov 28 '19 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5085
by: Michael Pedersen | last post by:
Hi group I want to be able to expand a huge form with a number of text fields. The number of fields must be entered in a form field and submitted, or alternatively be a drop down menu. I have...
2
3753
by: Irwinsp | last post by:
Hi All, I have a form with an auto number field displayed. The field looks great except when the user is entering a new record. The field then has the text "auto number" in it. Is there a...
0
1481
by: Megan | last post by:
Hi Everybody- I know that this is a really, really long post, but I wanted to try to give you as much background as possible. So here's a quick overview of the issues I'm asking for help with:...
8
2449
by: shumaker | last post by:
I see other posts where some say fields that will hold a number with leading zeros should be stored as text instead of numbers. This is very inefficient though, as a string of digit characters...
0
1092
by: Zammy | last post by:
I have a split database with the backend on a server and sometimes when the data is saved from a form the autonumber populates the autonumber field and the account number field in the table. I have...
3
2164
by: linsha | last post by:
hi... I would like to know about maximum number number of fields that can be created in a table. my requirement is to meet data entry in morethan 300 fields. I am using SQL 2000. if impossible is...
2
12504
by: andy.bayley | last post by:
Hi - and thanks for reading this. I'm setting up a scheduled routine which links to an existing file. It's bringing in one field which has at least 2 and maybe 10 'words', separated by spaces,...
5
3001
by: Alex Hoilo | last post by:
Hello, I'm a novice to VBA and need to import raw data into an access database. I created the table, it contains 87 fields, all numeric. The data I have looks like this: ...
4
1028
by: minfas | last post by:
EXp 290501049125 like this number field i need this to be split 12 fileds like Field1 (2) Field2 (9) filed3 (0) filed4 (5) etc. Can Any one help to solve this issue?
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.