Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks
$ConnString = "Provider=vfpoledb.1;Data Source=C:\dispatch\dispatch.dbc;Collating Sequence=machine;" $Conn = new-object System.Data.OleDb.OleDbConnection($connString) $conn.open() $sql = "select ((sum(endmile)) - (sum(pickupmileage))) as MilesToday from dispatch where date = DTOT(date())" $obj = new-object System.object #Total Miles Today Query $cmd = new-object System.Data.OleDb.OleDbCommand($sql,$Conn) $da = new-object System.Data.OleDb.OleDbDataAdapter($cmd) $dt = new-object System.Data.dataTable $da.fill($dt) $dt
$items = $da.fill($dt) add-member -inputobject $obj -membertype NoteProperty -Name TotalMiles -value $items Write-output $obj
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.