Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)

  • RE: getting data from four tables and using COUNT()

    ok if I have the result of 3 temp tables like this:

    -------------------------------------------

    Table #hpRating:

    -------------------------------------------

    FoodItemId Name ...

    Thanks & Regards,
    Hem Singh

  • RE: getting data from four tables and using COUNT()

    sorry for not giving that variable. it can be any RestoId from MenuFoodItems table:

    DECLARE @RestoId int

    SET @RestoId=1;

    and the result will be used in the link: http://yummyrepublic.com/test/restaurant.php?rId=6

    and the image for this...

    Thanks & Regards,
    Hem Singh

  • RE: Multiple columns search with some blank/null values

    I have used dynamic SQL query.... because there is written that there is no fear of Sql injection because Query is still using parameters. Fot this time i have implemented...

    Thanks & Regards,
    Hem Singh

  • RE: Multiple columns search with some blank/null values

    @j-2 Livingston thanks for the reply.

    there are multiple solutions in the link you provided. still thinking which one is best.

    Regards,

    Hem Singh

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    nice Brandie. I have checked yr site... interested journey...

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    Ninja's_RGR'us (1/14/2012)


    I would use nvarchar(max) in this case for the simple reason that a single region might have a massive list of ids and that the ids will be longer...

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    Ninja's_RGR'us (1/13/2012)


    I work on massive ERP reports. Some of my reports have 20 parameters so you need to get inventive to both get the correct results and with fast...

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    Hi friends,

    as I said my query is working fine for single value but when localityIds are coming in comma separated 2 values e.g. '2,3' the error is 'unable to convert...

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    giving error for @vals which are int type:

    unable to cast nvarchar to int.... very confusing....

    i have converted from int to nvarchar then other error. :

    .....

    @CityId int,

    @LocalityId nvarchar(50),

    @PriceFrom money,

    @PriceTo money,

    @Bedrooms...

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    Brandie Tarvin (1/13/2012)


    I refer you back to my last response.

    Use IN instead of = on the stored procedure and concatenate the values together......

    Hi Brandie Tarvin,

    I am trying yr suggestion.....

    Thanks & Regards,
    Hem Singh

  • RE: search query as per selected checkboxes

    Hi,

    Thanks for the reply. currently i m using the below query(in short here):

    ALTER PROCEDURE [dbo].[Property_Search]

    @CityId int,

    @PriceFrom money,

    @PriceTo money,

    @Bedrooms nvarchar(20)

    AS

    BEGIN

    SELECT

    ,[State]

    ,[City]

    ,Locality

    FROM cj_ListProperty

    ...

    Thanks & Regards,
    Hem Singh

  • RE: Column Name & matching string as variables

    thanks ghanshyam .. i did it another way I will try your one later and will let u know. thanks to all.

    Thanks & Regards,
    Hem Singh

  • RE: Column Name & matching string as variables

    ghanshyam.kundu (9/23/2011)


    I think your date format is wrong

    @searchstring should be in 'yyyy-mm-dd' format or you can convert it to datetime

    convert(@searchstring as datetime)

    I have already tried convert and cast; and...

    Thanks & Regards,
    Hem Singh

  • RE: Column Name & matching string as variables

    hi,

    I am getting error when my search string is a date. the SP i am using is:

    ALTER PROCEDURE cj_Customers_Search

    @SearchText varchar(250),

    --@SearchDate DateTime,

    @FieldName varchar(100)

    AS

    BEGIN

    SET NOCOUNT ON;

    DECLARE @selectResult nvarchar(max);

    DECLARE @SearchDate DateTime

    IF @FieldName =...

    Thanks & Regards,
    Hem Singh

  • RE: Column Name & matching string as variables

    my search string is coming in string format from dateTimePicker of winform and i am trying like this:

    WHERE '+@FieldName + ' = ' + CAST(@SearchText AS datetime);

    -- I have also...

    Thanks & Regards,
    Hem Singh

Viewing 15 posts - 1 through 15 (of 18 total)