Jump to content

absurd problem with sql


Recommended Posts

i working on a script that take info froma MS SQL server 2k and tranfer it to a excel object

the problem is in this simple code:

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Driver={SQL Server};Server=192.9.200.6;Database=MVXJDTA;Uid=Test;Pwd=tesT;")
$RS=$sqlCon.EXECUTE("SELECT KPPCDT,* FROM MVXJDTA.MCCOMA WHERE  KPVASE in ('604AA000001') AND KPPCDT=20031215")
MsgBox(1,"",$RS.fieldS("KPPCDT").VALUE)

the text that appears on the msgbox is "20031216"

i dont find logical on this,I'm saying explicitly that should be KPPCDT=20031215, and i take that field again on the msg box

if i execute these same sql on a querys program the field is correct

Link to comment
Share on other sites

What about

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Driver={SQL Server};Server=192.9.200.6;Database=MVXJDTA;Uid=Test;Pwd=tesT;")
$RS=$sqlCon.EXECUTE("SELECT * FROM MVXJDTA.MCCOMA WHERE  KPVASE in ('604AA000001') AND KPPCDT=20031215")
MsgBox(1,"",$RS.fieldS("KPPCDT").VALUE)

An example of the contents of the database might help too :)

Cheers,

Brett

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...