|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
SQL/scripting (Substring?) question
Hi all.
This page, http://pjshimmer.tripod.com/movies3.html, contains info of my movie collection. I have the title and year in one table cell, as in Lord of the Rings (2001). I intend to put all the info in an Access database, but I would like to have separate fields for Title and Year. So I wonder if there is a script or SQL statement to achieve this? The pseudocode can work like this: 1. Find open parenthesis "(" in field -Table- 2. select everything after "(" 3. move the selection to the new field -Year- Any help on achieving this would be appreciated, as I don't want to retype 500 year fields! ![]() Last edited by vb.net : May 6th, 2003 at 01:41 PM. |
|
#2
|
|||
|
|||
|
and your db is?
|
|
#3
|
||||
|
||||
|
the db was mentioned, merl -- Access
load the titles into a table with a column called title then create a second table like this: Code:
select Left(title,Len(title)-Instr(title,'(')-1) as titleonly
, Mid(title,Instr(title,'(')+1,4) as yearonly
into newtable
from firsttable
Xxxxxxx (Yyyyyy) Zzzzzz (1971) -- title contained parenthesis Aaaaaaaaaaaa Bbbbbbbbbb -- title had no parenthesized year so run a quick check by looking at the yearonly column that was created -- Code:
select titleonly, yearonly
from newtable
where yearonly < '1900'
or yearonly > '2003'
http://r937.com/ |
|
#4
|
|||
|
|||
|
You're right r937. I'm such a fool. My apologies.
|
|
#5
|
||||
|
||||
|
no prob
braincramps -- i have them regularly too ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > SQL/scripting (Substring?) question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|