#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    1
    Rep Power
    0

    sql/vb statement help


    Heres my vb code
    Dim sql As String = "SELECT P_Name, C_PeriodTo from PROPOSER, POLICY where DATEDIFF(DD, GETDATE(), C_PeriodTo)>1 AND DATEDIFF(DD, GETDATE(), C_PeriodTo)<28 AND P_RegnNo=C_RegnNo"

    However, the result is different from what I get using Sql Query Analyzser. May I know if there is any special characters in the code that might be causing the difference?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    SC
    Posts
    26
    Rep Power
    0

    Unhappy Just a Guess... But I'll Try.....


    I originally wrote a bunch more, but now that I'm looking:

    ======================
    AND P_RegnNo=C_RegnNo"
    ======================

    These are not in the select statement. So the numbers are not going to match I believe. There will never be an equals? Do you not have to select these to be able to parse them?

    Hope it helps!
    Last edited by emladris; October 1st, 2003 at 09:54 AM.

IMN logo majestic logo threadwatch logo seochat tools logo