Click here to Skip to main content
16,008,490 members
Home / Discussions / Database
   

Database

 
QuestionASP .NET, MS SQL Server 2000 with Window XP SP2 <- does not work??? Pin
Thang T.4-Feb-05 22:46
Thang T.4-Feb-05 22:46 
AnswerRe: ASP .NET, MS SQL Server 2000 with Window XP SP2 <- does not work??? Pin
Hesham Amin4-Feb-05 23:05
Hesham Amin4-Feb-05 23:05 
GeneralRe: ASP .NET, MS SQL Server 2000 with Window XP SP2 <- does not work??? Pin
Thang T.5-Feb-05 0:32
Thang T.5-Feb-05 0:32 
GeneralSQL Server fills event log Pin
Hesham Amin4-Feb-05 20:00
Hesham Amin4-Feb-05 20:00 
GeneralRe: SQL Server fills event log Pin
Hesham Amin4-Feb-05 23:48
Hesham Amin4-Feb-05 23:48 
GeneralDifficult JOIN Pin
Luis Alonso Ramos4-Feb-05 15:24
Luis Alonso Ramos4-Feb-05 15:24 
GeneralRe: Difficult JOIN Pin
Yulianto.4-Feb-05 16:05
Yulianto.4-Feb-05 16:05 
GeneralRe: Difficult JOIN Pin
Luis Alonso Ramos4-Feb-05 19:18
Luis Alonso Ramos4-Feb-05 19:18 
Yulianto AKA goodmast3r wrote:
you mean each customer has many cities?

The software is for a door-to-door credit company, so it's necessary to keep a history of all the addresses where the customer has lived.

At one point one customer has one address (his house) but when (and if) he moves, you'll need to save the new address (with a more recent lives-here-since date.) It's not that he'll move to another city, but sometimes big cities are made of a few (or many) counties together, and although it's the same metropolitan area, legally they are different counties.

So, I need to get the county (or city) of the latest address for each customer that meets my search criteria.

An example:
Customers
ID_customer Name
    1       Luis Alonso Ramos
    2       John Smith

Addresses
ID_address ID_customer Street                City     LivesHereSince
    1           1      123 CodeProject St.     1         1/1/2001
    2           1      22  Maunder Ave.        2         1/1/2002
    3           2      2222 5th Ave.           1         1/1/1999

Cities
ID_city   Name
   1      Los Angeles
   2      Beverly Hills
So if I make a search for customers whose name starts with L, I should get:
ID_customer Name              City
    1     Luis Alonso Ramos   Beverly Hills
I hope this is clearer now. So, any ideas of how I can do it?? Confused | :confused:

Thanks!

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

GeneralRe: Difficult JOIN Pin
Mike Dimmick5-Feb-05 1:52
Mike Dimmick5-Feb-05 1:52 
GeneralRe: Difficult JOIN Pin
Luis Alonso Ramos5-Feb-05 6:41
Luis Alonso Ramos5-Feb-05 6:41 
GeneralRe: Difficult JOIN Pin
Mike Dimmick5-Feb-05 7:32
Mike Dimmick5-Feb-05 7:32 
GeneralRe: Difficult JOIN Pin
Luis Alonso Ramos5-Feb-05 8:13
Luis Alonso Ramos5-Feb-05 8:13 
Generali can't to insert a new row Pin
Sasuko4-Feb-05 6:38
Sasuko4-Feb-05 6:38 
GeneralRe: i can't to insert a new row Pin
tojamismis4-Feb-05 6:52
tojamismis4-Feb-05 6:52 
GeneralRe: i can't to insert a new row Pin
Sasuko4-Feb-05 11:00
Sasuko4-Feb-05 11:00 
GeneralRe: i can't to insert a new row Pin
tojamismis4-Feb-05 11:23
tojamismis4-Feb-05 11:23 
GeneralRe: i can't to insert a new row Pin
Sasuko4-Feb-05 11:30
Sasuko4-Feb-05 11:30 
GeneralRe: i can't to insert a new row Pin
tojamismis4-Feb-05 14:11
tojamismis4-Feb-05 14:11 
GeneralRe: i can't to insert a new row Pin
Sasuko4-Feb-05 22:29
Sasuko4-Feb-05 22:29 
GeneralRe: i can't to insert a new row Pin
Sasuko4-Feb-05 23:58
Sasuko4-Feb-05 23:58 
GeneralRe: i can't to insert a new row Pin
tojamismis5-Feb-05 4:49
tojamismis5-Feb-05 4:49 
GeneralRe: i can't to insert a new row Pin
Sasuko5-Feb-05 12:22
Sasuko5-Feb-05 12:22 
GeneralRe: i can't to insert a new row Pin
tojamismis5-Feb-05 4:47
tojamismis5-Feb-05 4:47 
GeneralRe: i can't to insert a new row Pin
tojamismis5-Feb-05 4:58
tojamismis5-Feb-05 4:58 
GeneralEnterprise manger Pin
Tom Wright4-Feb-05 5:50
Tom Wright4-Feb-05 5:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.