Click here to Skip to main content
16,011,996 members
Home / Discussions / Database
   

Database

 
QuestionAccessing database file (.sdf) after changing extension (say .abc) causes error in connection string. Pin
ManishJape9-May-07 0:51
ManishJape9-May-07 0:51 
Questionget the table name in a .mdb file Pin
hero19958-May-07 23:41
hero19958-May-07 23:41 
AnswerRe: get the table name in a .mdb file Pin
hero19959-May-07 21:37
hero19959-May-07 21:37 
Questionneed query(urgent) Pin
Revathi Raj8-May-07 23:30
Revathi Raj8-May-07 23:30 
AnswerRe: need query(urgent) Pin
Colin Angus Mackay8-May-07 23:36
Colin Angus Mackay8-May-07 23:36 
QuestionHow to diplay reports in reportview control?Pls help its URGENT!! Pin
sha_shivani8-May-07 13:34
sha_shivani8-May-07 13:34 
GeneralSearch Routine Pin
Brady Kelly8-May-07 4:55
Brady Kelly8-May-07 4:55 
GeneralRe: Search Routine Pin
andyharman8-May-07 6:13
professionalandyharman8-May-07 6:13 
Its a bit ugly, but I think the following should do the trick:
select P.Name, T.PhoneNumber
from TelPerson as P
inner join TelNumber as N
on N.PersonId = P.PersonId
where (@SearchName = '' or P.Name LIKE '%' + @SearchName + '%')
and (N.PhoneNumber = @SearchPhone or (
   @SearchPhone = '' and 
   N.PhoneNumber in (
      select min(PhoneNumber) from TelNumber where PersonId = P.PersonId)
   ))
order by P.Name, P.PersonId, T.PhoneNumber
This assumes that a blank-string equals no criteria. If possible then I would recommend using a stored procedure to make the code more logical.

Regards
Andy
GeneralRe: Search Routine Pin
Brady Kelly9-May-07 0:44
Brady Kelly9-May-07 0:44 
GeneralRe: Search Routine Pin
Michael Potter8-May-07 8:22
Michael Potter8-May-07 8:22 
Questionneed help for sqlserver2005 reporting service Pin
Doshi Divyesh8-May-07 3:49
Doshi Divyesh8-May-07 3:49 
QuestionOracle buffer.. not sure Pin
Muammar©8-May-07 1:35
Muammar©8-May-07 1:35 
AnswerRe: Oracle buffer.. not sure Pin
andyharman8-May-07 1:52
professionalandyharman8-May-07 1:52 
QuestionRe: Oracle buffer.. not sure Pin
Muammar©8-May-07 20:58
Muammar©8-May-07 20:58 
AnswerRe: Oracle buffer.. not sure Pin
andyharman9-May-07 0:10
professionalandyharman9-May-07 0:10 
QuestionSubstring Problems help Pin
Vimalsoft(Pty) Ltd8-May-07 0:50
professionalVimalsoft(Pty) Ltd8-May-07 0:50 
AnswerRe: Substring Problems help Pin
Colin Angus Mackay8-May-07 1:04
Colin Angus Mackay8-May-07 1:04 
GeneralRe: Substring Problems help Pin
Vimalsoft(Pty) Ltd8-May-07 1:19
professionalVimalsoft(Pty) Ltd8-May-07 1:19 
GeneralRe: Substring Problems help Pin
Colin Angus Mackay8-May-07 2:58
Colin Angus Mackay8-May-07 2:58 
GeneralRe: Substring Problems help Pin
Vimalsoft(Pty) Ltd8-May-07 3:37
professionalVimalsoft(Pty) Ltd8-May-07 3:37 
GeneralRe: Substring Problems help Pin
Colin Angus Mackay8-May-07 3:48
Colin Angus Mackay8-May-07 3:48 
Questionmas TCP connection? Pin
D2raghu8-May-07 0:13
D2raghu8-May-07 0:13 
Questionmysql Pin
WhiteGirl237-May-07 22:50
WhiteGirl237-May-07 22:50 
QuestionHaving trouble with Ado control in vb6 Pin
Vimalsoft(Pty) Ltd7-May-07 20:57
professionalVimalsoft(Pty) Ltd7-May-07 20:57 
Questioninsert null into datetime field in sql Pin
yesu prakash7-May-07 18:31
yesu prakash7-May-07 18:31 

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.