subquery is not working for CSV files

S

Shiplu

HI,
this is my query, I am using C# , OleDB, ADO.NET and CSV files.

SELECT [GATEWAY],[IPADD], SUM(MOBILE),SUM(NWD), TOTAL FROM
[rawdata.csv] where CVDate([START]) >= '7/29/2006' AND CVDate([END])
<= '8/23/2006' AND [GATEWAY] IN (SELECT [GATEWAY] FROM [gateways.csv]
WHERE [CLIENT]='MR. XXX') GROUP BY [GATEWAY],[IPADD] ORDER BY [GATEWAY]

it returnes no rows.

but I have done it in mysql with same data file and same query. it
worked.
why it's not working ?
is there any problem in subquery syntax ?

please give me a solve.
 
P

Paul Clement

¤ HI,
¤ this is my query, I am using C# , OleDB, ADO.NET and CSV files.
¤
¤ SELECT [GATEWAY],[IPADD], SUM(MOBILE),SUM(NWD), TOTAL FROM
¤ [rawdata.csv] where CVDate([START]) >= '7/29/2006' AND CVDate([END])
¤ <= '8/23/2006' AND [GATEWAY] IN (SELECT [GATEWAY] FROM [gateways.csv]
¤ WHERE [CLIENT]='MR. XXX') GROUP BY [GATEWAY],[IPADD] ORDER BY [GATEWAY]
¤
¤ it returnes no rows.
¤
¤ but I have done it in mysql with same data file and same query. it
¤ worked.
¤ why it's not working ?
¤ is there any problem in subquery syntax ?

Try enclosing the date values within # sign characters instead of single quotes.

I think what's happening is that you're performing a string comparison instead of a date comparison.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
S

Shiplu

Paul said:
¤ HI,
¤ this is my query, I am using C# , OleDB, ADO.NET and CSV files.
¤
¤ SELECT [GATEWAY],[IPADD], SUM(MOBILE),SUM(NWD), TOTAL FROM
¤ [rawdata.csv] where CVDate([START]) >= '7/29/2006' AND CVDate([END])
¤ <= '8/23/2006' AND [GATEWAY] IN (SELECT [GATEWAY] FROM [gateways.csv]
¤ WHERE [CLIENT]='MR. XXX') GROUP BY [GATEWAY],[IPADD] ORDER BY [GATEWAY]
¤
¤ it returnes no rows.
¤
¤ but I have done it in mysql with same data file and same query. it
¤ worked.
¤ why it's not working ?
¤ is there any problem in subquery syntax ?

Try enclosing the date values within # sign characters instead of single quotes.

I think what's happening is that you're performing a string comparison instead of a date comparison.


Paul
~~~~
Microsoft MVP (Visual Basic)

hi,
I am extremly sorry for this kind of question.
I got the problem. its in [clients.csv].
[GATEWAY] column and [CLIENT] column was altered.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top