avatar
a*t
1
I am trying to duplicate a Foxpro program with C#.NET and have some data
result problems. I am not getting the same result from .NET code as from
Foxpro.
Does anyone know if Foxpro (it is currently running on Visual Foxpro 6.0, not
sure in what version of framework it was developed on) use stardard T-SQL?
Anything funny on "JOIN" 's, or anything?
I guess there shouldn't be, but just want to make sure. I should probably look
and compare the SQL statements between the two versions more closely. I
avatar
s*n
2
Don't know Foxpro. If you post more detail about what you want to accomplish
with .NET code, I think many ppl can help you here.

【在 a*******t 的大作中提到】
: I am trying to duplicate a Foxpro program with C#.NET and have some data
: result problems. I am not getting the same result from .NET code as from
: Foxpro.
: Does anyone know if Foxpro (it is currently running on Visual Foxpro 6.0, not
: sure in what version of framework it was developed on) use stardard T-SQL?
: Anything funny on "JOIN" 's, or anything?
: I guess there shouldn't be, but just want to make sure. I should probably look
: and compare the SQL statements between the two versions more closely. I

avatar
a*t
3
after some headache, I found there are at least two strange (or by design)
behaviors in FoxPro.
1. the following statement runs in FoxPro, but not in SQL Server
select ID, sum(charges), invoiceDate
from tableA
group by ID
what FoxPro does is execute this as max(invoiceDate), while SQL Server refuses
to run the statement unless I put in the "max".
2. this statement runs in both FP and SQL Server, but with different results.
select ID, invoiceDate
from tableA
where ID not in (select ID from tableA

【在 s******n 的大作中提到】
: Don't know Foxpro. If you post more detail about what you want to accomplish
: with .NET code, I think many ppl can help you here.

avatar
s*n
4
1. SQL Server is doing the right thing, you either need to have invoiceDate
in the "group by " list or you need to specify an aggregation operator such
as AVG, MAX, etc.
2. The query itself seems ridiculous. If I understand it right, it is the
same as follows:
select ID, invoiceDate from tableA where invoiceDate >= '2005-1-1'
Do u know the original purpose of this query?

【在 a*******t 的大作中提到】
: after some headache, I found there are at least two strange (or by design)
: behaviors in FoxPro.
: 1. the following statement runs in FoxPro, but not in SQL Server
: select ID, sum(charges), invoiceDate
: from tableA
: group by ID
: what FoxPro does is execute this as max(invoiceDate), while SQL Server refuses
: to run the statement unless I put in the "max".
: 2. this statement runs in both FP and SQL Server, but with different results.
: select ID, invoiceDate

avatar
a*t
5
I had to simplify/fix a lot of queries like those. not sure why they were
written that way before. might be the develper did too much cut and paste and
never went back to clean up the code since it worked in foxpro.

refuses
results.
but
accomplish

【在 s******n 的大作中提到】
: 1. SQL Server is doing the right thing, you either need to have invoiceDate
: in the "group by " list or you need to specify an aggregation operator such
: as AVG, MAX, etc.
: 2. The query itself seems ridiculous. If I understand it right, it is the
: same as follows:
: select ID, invoiceDate from tableA where invoiceDate >= '2005-1-1'
: Do u know the original purpose of this query?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。