Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Will I need vb script or SQL does it?

Status
Not open for further replies.

srd

Technical User
Oct 16, 2001
14
0
0
PT
Hi!

I will try to explain my problem.

I would like to control my costs with my mobile phone so I have created a database with 2 tables. A table with records of all calls made [callsmade] in a certain period and another with the all my phone numbers from my phone book [phonebook].

What I want to do is to relate to each call I made, if it was a professional call or a personal one. For that I have created a field in the phone book table called type, in which I associate to that number a personal or professional phone number. What I just don't know how to do, is to create a new table, or update the table callsmade, with that field, so that I have to that period of calls made which were professional or not.

Do I need a vb script to run to each callmade or a SELECT does the work?

Can somebody help me?

Many Thanks

sIMAO d.
 
SQL can do all, including fair trade coffee ;-)

You need two tables, one is you phone-book:
create table phonebook
( name varchar(20),
phone_number varchar(20),
status varchar(10) -- private, prof...
)
insert phonebook values 'sweetie', '12345', 'private'
insert phonebook values 'Big Co Inc', '98765', 'prof'

The other the actual calls:
create table callsmade
( phone_number varchar(20),
date_call datetime
)
-----------

select p.name,
p.phone_number,
c.date_call,
p.status
from callsmade c
left join phonebook p on p.phone_number = c.phone_number

Note that for calls made to unknown number, name and status will be null


Hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top