Results 1 to 2 of 2

Thread: [2005] Sql Express Problem.

  1. #1

    Thread Starter
    Hyperactive Member gooden's Avatar
    Join Date
    Dec 2006
    Location
    Portugal
    Posts
    274

    [2005] Sql Express Problem.

    Well i have a little problem with the query that im making.

    The problem is that i use a PT OS but some of my clients use an English OS. when i make the query in my computer it goes ok but in some of my clientes that are using the OS in English it does not work.

    vb.net Code:
    1. where cast(CONVERT(smalldatetime, o.data,101)as smalldatetime) BETWEEN cast('1/1/1999' as smalldatetime) AND cast('1/1/2009' as smalldatetime)"

    This code works but if i use it in a OS English it says That cannot convert char to small date.

    Is there other way to make a select between dates and finish with this errors? =)

    Glad if you could help


    The Future Is Always The Way To Live The Life

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [2005] Sql Express Problem.

    Thread moved to Database Development forum - which is where questions purely about SQL statements belong

    You seem to have an extra Cast that isn't needed (around the Convert), and that could be causing the error. Try removing it, eg:
    Code:
    where CONVERT(smalldatetime, o.data,101) BETWEEN ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width