Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Cant get this to work!!

alf_chavezalf_chavez Member Posts: 12
Im making a program that has to find one particular date on a table, but i cant get it to work, i dont know if the syntax is well or what is going on wrong.

I also want to know if after the where clause I can use a comparison
for example:

("select * from Ventas where fecha_v =" & Date & " and codigo = " & txtcod.text & "")

DataEnvironment1.Connection1.Open
sqltext1 = ("select * from Ventas where fecha_v =" & Date)
Set rs = DataEnvironment1.Connection1.Execute(sqltext1)
If rs.RecordCount = 1 Then......

Comments

  • infidelinfidel Member Posts: 2,900
    [b][red]This message was edited by infidel at 2002-10-11 15:6:31[/red][/b][hr]
    : Im making a program that has to find one particular date on a table, but i cant get it to work, i dont know if the syntax is well or what is going on wrong.
    :
    : I also want to know if after the where clause I can use a comparison
    : for example:
    :
    : ("select * from Ventas where fecha_v =" & Date & " and codigo = " & txtcod.text & "")

    This should work just fine, but you need to put single-quotes around any non-numeric values:

    [code]
    strSQL = "select * from Ventas " & _
    "where fecha_v = '" & Date & "' " & _
    "and codigo = '" & txtcod.text & "'"
    [/code]

    You probably want to also make sure the Date value is in the correct format, i.e. Format(Date,"MM/DD/YYYY")

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ____ < http://forcoder.org /> free ebooks and video tutorials about \ Assembly C++ PL/SQL PHP Python Java C Delphi Perl Visual Basic Go Objective-C R Scratch Swift Visual Basic .NET C# MATLAB JavaScript Ruby Erlang D FoxPro VBScript Fortran Alice Clojure Scheme Hack Ada Awk Scala Rust Lua Bash Logo ABAP Dart Transact-SQL ML Lisp Julia COBOL Apex F# LabVIEW Prolog Crystal Kotlin SAS \ _______

Sign In or Register to comment.