Click here to Skip to main content
15,893,588 members
Home / Discussions / Database
   

Database

 
GeneralRe: Sql Connection Pin
Paul Conrad27-Jul-07 19:46
professionalPaul Conrad27-Jul-07 19:46 
QuestionFull Text Search Query Weird Results Pin
Brendan Vogt26-Jul-07 17:30
Brendan Vogt26-Jul-07 17:30 
AnswerRe: Full Text Search Query Weird Results Pin
Stathread26-Jul-07 18:54
Stathread26-Jul-07 18:54 
QuestionRe: Full Text Search Query Weird Results Pin
Brendan Vogt26-Jul-07 21:02
Brendan Vogt26-Jul-07 21:02 
QuestionRe: Full Text Search Query Weird Results Pin
Vinay Dornala26-Jul-07 18:55
Vinay Dornala26-Jul-07 18:55 
QuestionRe: Full Text Search Query Weird Results Pin
Brendan Vogt26-Jul-07 20:34
Brendan Vogt26-Jul-07 20:34 
AnswerRe: Full Text Search Query Weird Results Pin
Stathread27-Jul-07 2:56
Stathread27-Jul-07 2:56 
QuestionQuery problem Pin
firestoper26-Jul-07 17:03
firestoper26-Jul-07 17:03 
Hi Guru's,

I made a basic search filtering query, it searches for the predefine (default) values when user does not place any values on search fields, my search query works fine but not until having the sort option, below is my query and my db structure:

TABLE:
ListingID int
HLCN varchar(6)
HousePrice money
Bathrooms float
Bedrooms int
HomeLocation varchar(50)
ContactName varchar(50)
EmailContact varchar(50)
PhoneContact varchar(50)
Address varchar(100)
SquareFeet varchar(50)
YearBuilt varchar(50)
LotSize varchar(50)
Garage varchar(50)
Notes varchar(255)

QUERY:
declare @sort nvarchar(50)
set @sort ='HomeLocation'
Select
listingID,
HLCN,
HousePrice,
Bedrooms,
Bathrooms,
HomeLocation,
ContactName
from
listings
where
houseprice between 0 and 100000000
and
bathrooms >= 0
and
bedrooms >= 0
and
homelocation like '%' + '' + '%'
order by
case @sort
when 'HomeLocation' then HomeLocation
when 'HousePrice' then HousePrice
end


when I sort by HousePrice it return correct resultm but when I sort by Homelocation it returned

Cannot convert a char value to money. The char value has incorrect syntax.
I'm wondering whey It's causing char-to- money conversion error when I'm not passing char values and also this only happens when I'm using HomeLocation as sort.

Please advice,

Thanks
Dom
AnswerRe: Query problem Pin
Eliz.k26-Jul-07 23:51
Eliz.k26-Jul-07 23:51 
GeneralRe: Query problem Pin
firestoper30-Jul-07 4:05
firestoper30-Jul-07 4:05 
GeneralRe: Query problem Pin
firestoper30-Jul-07 4:05
firestoper30-Jul-07 4:05 
QuestionFull Text Searching in SQL Server 2005 Pin
Brendan Vogt26-Jul-07 17:00
Brendan Vogt26-Jul-07 17:00 
Questioncolumn to row Pin
Shrita26-Jul-07 13:42
Shrita26-Jul-07 13:42 
QuestionHow to get the table size (Byte)? Pin
Khoramdin26-Jul-07 9:25
Khoramdin26-Jul-07 9:25 
AnswerRe: How to get the table size (Byte)? Pin
Krish - KP26-Jul-07 21:35
Krish - KP26-Jul-07 21:35 
QuestionSQL SELECT query Pin
xoxoxoxoxoxox26-Jul-07 7:09
xoxoxoxoxoxox26-Jul-07 7:09 
AnswerRe: SQL SELECT query Pin
andyharman26-Jul-07 7:32
professionalandyharman26-Jul-07 7:32 
AnswerRe: SQL SELECT query Pin
Krish - KP26-Jul-07 21:33
Krish - KP26-Jul-07 21:33 
QuestionSelect employees haveing thier birthday with in coming 2 weeks Pin
Vipin.d26-Jul-07 5:52
Vipin.d26-Jul-07 5:52 
AnswerRe: Select employees haveing thier birthday with in coming 2 weeks Pin
andyharman26-Jul-07 6:43
professionalandyharman26-Jul-07 6:43 
GeneralRe: Select employees haveing thier birthday with in coming 2 weeks Pin
Vipin.d27-Jul-07 20:47
Vipin.d27-Jul-07 20:47 
AnswerRe: Select employees haveing thier birthday with in coming 2 weeks Pin
Pete O'Hanlon26-Jul-07 8:53
mvePete O'Hanlon26-Jul-07 8:53 
GeneralRe: Select employees haveing thier birthday with in coming 2 weeks Pin
Vipin.d27-Jul-07 20:26
Vipin.d27-Jul-07 20:26 
GeneralRe: Select employees haveing thier birthday with in coming 2 weeks Pin
Pete O'Hanlon29-Jul-07 10:15
mvePete O'Hanlon29-Jul-07 10:15 
AnswerRe: Select employees haveing thier birthday with in coming 2 weeks Pin
Vipin.d27-Jul-07 20:48
Vipin.d27-Jul-07 20:48 

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.