query question

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,
I have a field like:
Size
12.2X9.1
12.2X9.1
8.6X11.6
8.6X11.6
9.0X12.0
9.2X12.1
9.1X11.9
8.11X11.11

How to write a query and display it like:
Width length
12.2 9.1
12.2 9.1
8.6 11.6
8.6 11.6
9.0 12.0
9.2 12.1
9.1 11.9
8.11 11.11


Thanks,
 
Try something along the lines of
SELECT Left(Size, InStr(Size, "X") - 1) As Width,
Right(Size, InStr(Size, "X") + 1) As Length,

Hope This Helps
Gerald Stanley MCSD
 
1. Create a query into this table.

2. In a blank column of the Field row, enter:
Val(Left([Size], Instr([Size], "X") - 1))

3. In the next column, enter:
Val(Mid([Size], Instr([Size], "X") + 1))

4. Test.

5. Change the query to an Update query: Update on Query menu.
Access adds an Update row to the query design grid.

6. Move the expressions above into the Update row under your Width and
Length fields (assuming you have already created numeric fields to accept
the data).

7. Run the query.
 
Use these expressions:
Width = Left([NameOfField],InStr([NameOfField],"X")-1)
Length = Mid([NameOfField],InStr([NameOfField],"X")+1)
 
Back
Top