hypz Posted June 12, 2012 Report Share Posted June 12, 2012 Dim sql1 As String = "Select from Valor_Total from Historico where Data_Carregamento='" & 2012 - 6 - 11 & "'" Gostava de saber se esta query está correcta 😉 Link to comment Share on other sites More sharing options...
Caça Posted June 12, 2012 Report Share Posted June 12, 2012 Não, tens dois froms e a data deve ir sem espaços Select from Valor_Total from Historico Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
hypz Posted June 12, 2012 Author Report Share Posted June 12, 2012 (edited) Dim sql1 As String = "Select Valor_Total from Historico where Data_Carregamento='" & 2012 - 6 - 11 & "'" isto ? E o vb poe os espaços automaticamente. Edited June 12, 2012 by hypz Link to comment Share on other sites More sharing options...
Caça Posted June 12, 2012 Report Share Posted June 12, 2012 Ainda não, ao fazeres isto 2012 - 6 - 11 o que ele vai fazer é subtrair números, a data deve ir dentro da string. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
hypz Posted June 12, 2012 Author Report Share Posted June 12, 2012 Dim sql1 As String = "Select Valor_Total from Historico where Data_Carregamento = '2012-06-11'" Assim ? o: Link to comment Share on other sites More sharing options...
Caça Posted June 12, 2012 Report Share Posted June 12, 2012 Sim. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
hypz Posted June 12, 2012 Author Report Share Posted June 12, 2012 Dá-me este erro, "Tipo de dados incorrecto na expressão de critérios." no OleDbException was unhandled" Link to comment Share on other sites More sharing options...
Caça Posted June 12, 2012 Report Share Posted June 12, 2012 Executa essa query no Access. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
hypz Posted June 12, 2012 Author Report Share Posted June 12, 2012 Obrigado já resolvi o problema. 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now