Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Same SQL for VFP and SQL Server with logical/bit field...
Message
From
12/05/2004 20:37:09
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Same SQL for VFP and SQL Server with logical/bit field...
Miscellaneous
Thread ID:
00903447
Message ID:
00903447
Views:
66
I have a DBF with a Logical field (ord_sent), and a matching SQL Server table with a bit field of the same name. Is it possible to use the same SELECT command against both tables where I'm referencing the logical/bit field? VFP seems to want .T. or .F., and SQL Server seems to want 0 or 1 (which makes since, since it's a "bit", not a logical). I'm trying to something along the lines of
SELECT *
  FROM qn_head
  WHERE ord_sent = 0
I can't change the field types in the DBF because its used by a legacy system, but I do have complete control over the SQL Server side. Is there any other syntax other than .T. and .F. that I can use to reference the logical field in the DBF? BTW, I'm not doing this in VFP, but in VB using ADO.NET and the VFP OleDb driver. Not sure if that makes any difference or not.

Worse case scenario, I change my VB code to put the SELECT command together differently based on the type of datasource, but I realy don't want to do that. It's much cleaner if I can get the same SQL to work with either datasource.

Thanks in advance for any suggestions.

-----
Lee Perkins
-----
Lee Perkins
TigerBase Technologies

"Lee is one that would plug his brain into the internet, if he could, and STILL scream for more" - Very good friend of Lee's
Reply
Map
View

Click here to load this message in the networking platform