473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

crystal report date to date query result

Hello,

I've query when I run it in the sql server it gives me the correct result ,but I put in my code the result changed?

This is my query
Expand|Select|Wrap|Line Numbers
  1. String data = "SELECT [dat] ,[product_id] FROM [market].[dbo].[product] where dat>='2012-11-1' and dat='2012-11-1' 
This is my code

Expand|Select|Wrap|Line Numbers
  1. SqlConnection con=new SqlConnection (@"Data Source=.\Ahmed;Initial Catalog=Market;Integrated Security=True");
  2. String data = "SELECT [dat] ,[product_id]FROM [market].[dbo].[product] where dat>='2012-11-1' and dat<='2012-11-31'";
  3. con.Open();
  4.  
  5. SqlDataAdapter ad1 = new SqlDataAdapter(data, con);
  6. DataSet ds1 = new DataSet();
  7. ad1.Fill(ds1);
  8. ReportDocument cr  = new ReportDocument();
  9.                         cr.Load(@"C:\Users\Ahmed\Documents\Visual Studio 2010\Projects\WindowsFormsApplication9\WindowsFormsApplication9\CrystalReport4.rpt");
  10.  
  11.                         cr.SetDataSource(ds1.Tables["product"]);
  12. crystalReportViewer1.ReportSource = cr;
The result in sql like this:

Product_id dat 101 2012-11-1 102 2012-11-1

In C# like this:

product_id dat 100 2012-10-10 101 2012-11-1 102 2012-11-1
Nov 4 '12 #1
0 1836

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matthew Louden | last post by:
I am new to crystal report. I have ASP.NET pages that show the search result. Since the search result is represented by datagrid, it will be nice to put a button on that page, and allows the user...
3
by: Matt MacDonald | last post by:
I'm trying to run a report using a form containing a crystal report viewer, but I keep getting an error saying tha "The specified value type is different to the current value type I'm trying to use...
0
by: vinodkadiyan | last post by:
Getting problem with date query problem while using selectionformula in VB with crystal report StrFormula = {payment_detail.recptdate}) in date(" & Format(DTPicker1.Value, "yyyy,mm,dd") & ") to...
3
by: haresh.amis | last post by:
hi to all, this is Haresh Bhatt, I make a view in MS SQL 2000 and execute it gives me expected result. but when I run the crystal report it gives me result in duplicate records. View work...
3
by: viral123 | last post by:
Hi all I have Branch name, employee name and some of the fields in my database. I have to create attendance report using crystal. The problem is in my report I want to display employee names...
3
by: acextreme | last post by:
Hi all, I have a big problem when I try to export from Crystal Report 8.5 in .pdf from VB6. I use a database made in SQL Server 2000. The problem is that all the decimal fields in database are...
11
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
3
by: agarwalsunitadhn | last post by:
hi... Currently i have a need for creation of crystal report. here user search according to some criteria and i want to display that search data in crystal report. So here what i need is to bind...
1
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, I have bumped into this issue where my application (which consistently reads the database) has to also create a crsytal report when requested. The crystal repost uses the same connection string...
3
by: metsu962 | last post by:
Okay so I've been tearing my hair out for weeks over this issue. What I have is a Crystal Report that's showing a table pulled from an Access Database. The database is a HUGE pile of junk and it...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.