home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,517 of 19,505   
   Tony to All   
   Is it possible to have this in sql selec   
   23 Nov 11 16:49:06   
   
   From: johansson.andersson@telia.com   
      
   Hello!   
      
   I just wonder if it's possible to have this DateTime.Today.AddYears(-14);   
   in a where statement of an sql select like this.   
      
   SelectCommand="SELECT OrderID, OrderDate, ShippedDate   
                              FROM Orders   
                              where CustomerID=@CustomerID   
                              and OrderDate >= DateTime.Today.AddYears(-14);"   
      
   I have tried but I get error so I don't think it's possible but just to be   
   sure I ask anyway.   
      
   //Tony   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca