|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
<code>
Dim queryString As String = "UPDATE [Auction] SET [Auction].[Status]='Open' WHERE ([Auction].[End_Date] <= #" & DateTime.now & "#)" </code> I run that on an msaccess database i have and it set's every record to closed, although only 2 are befor today so they should be the only ones closed. The DateTime.Now is correct as i have output it to a label and it is correct. Does anyone know what the problem could be? I have also tried this Dim queryString As String = "UPDATE [Auction] SET [Auction].[Status]='Closed' WHERE (Select [Auction].[Auction_ID] From [Auction] Where ([Auction].[End_Date] <= #" & DateTime.now & "#))" but this gives an error of "At most one record can be returned by this subquery" I am completely lost. Any help is greatly appreciated thx mat |
|
#2
|
||||
|
||||
|
what database are you using?
try this Code:
Dim queryString As String = "UPDATE Auction SET Status = 'Open' WHERE End_Date <= '" & DateTime.Now & "'" |
|
#3
|
|||
|
|||
|
Was an access database. I fixed the problem. I looked at other posts containging date problems and it seems
that access stores dates one way and requires u to search with sql another way :s. If any1 else is having trouble with a similar problem i will happily post my code thx mat |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL Query is wrong..... but why? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|