Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)

  • RE: Sorting Union

    Thank you somabk2007 & Lynn. Both solutions work perfect. 😀

  • RE: case statement in a where clause

    Thank you for your advice Celko, much appreciated. I will definately read up on ISO-8601 and ISO-11179.

    Your data element names are insane. Take deep breath and think about...

  • RE: case statement in a where clause

    LutzM (7/1/2011)


    You could change the query to to

    AND psf.assetRegion_ID >= @assetregion_id_min

    AND psf.assetRegion_ID <= @assetregion_id_max

    set @assetregion_id_min to 1, 2 or @assetRegion_ID and

    @assetregion_id_max to 2147483647 (max value for an INT data...

  • RE: case statement in a where clause

    Thanks for you replys.

    LutzM - That sounds like it might just work I will give it a go now and see.

    Dixie - Unfortunately I cannot use Dynamic Sql...

  • RE: useing IN clause with variable?

    Thanks for all your excellent advice!

    I will consider all options and see which works best in my situation.

    Thanks

    Darren

  • RE: useing IN clause with variable?

    Thanks,

    Speed is not an issue.

    The problem I have is when I run the query these line's do not work properly

    AND            pbas.adviser_type in (isnull(@new_adviser_type,pbas.adviser_type))

    AND            pbas.country in (isnull(@new_country,pbas.country))

    the...

  • RE: useing IN clause with variable?

    Thanks for your response RGR'us.

    I need to create a procedure to cover these search options on the application. 

    company_name, services_offered, adviser_type, country

    any one, or all of...

  • RE: useing IN clause with variable?

    David Thanks for that,

    I have also tried that approach, but as I have a few list strings passed in,  I would have to do lots of 'IF' statements to...

  • RE: useing IN clause with variable?

    Thanks John,

    I was hoping to avoid dynamic sql, but if there is no other way i will try that.

    Thanks

    Darren 

  • RE: Need help finding stop time

    sorry that should read...

    SELECT @start_date = max([time]) FROM table1 WHERE name = @name AND event = 'start'

    SELECT @stop_date = max([time]) FROM table1 WHERE name = @name AND event = 'stop'

    Darren

  • RE: Need help finding stop time

    You could try this...

    DECLARE @start_date AS DATETIME

    DECLARE @stop_date AS DATETIME

    DECLARE @name AS VARCHAR(10)

    SET @name='Name1'

    SELECT @start_date = [time] FROM table1 WHERE name = @name AND event = 'start'

    SELECT @stop_date = [time] FROM table1 WHERE name = @name AND event = 'stop'

    SELECT DATEDIFF(mi, @stop_date, @start_date) --...

  • RE: eliminating where clause if variable not supplied

    Thanks RGR'us, Deepak!

    I had tried the string concatenation but it was a bit messy and I couldn't quite get it to work!

    RGR'us, that solution is perfect.

    Thanks

    Darren

  • RE: Last login date

    Thanks for your responses.  I'll give them a try.

     

Viewing 13 posts - 1 through 13 (of 13 total)