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 has a text based Date field!! Unbelievable.
This causes my Crystal Report a bunch of problems as I have to convert the date text data to date and compare it to the user inputted date to find records between the inputted dates. All would be swell if some of the entries were not blank!
Here's what I have when the user runs a filter and filters a date:
sQuery = "CDATE({tablena me.datefield}) >= CDATE('01/01/2008')";
CrystalReportvi ewer1.Selection Formula = sQuery;
CrystalReportvi ewer1.RefreshRe port();
It works fine if the date is not empty and I've tried to tell the Report "Convert Database Null Values to Default" but all that nets me is an error message of
"Bad Date Format String" because of the blank field trying to be converted. It appears the Convert Database Null Values does not work, or is not helpful at all on this end.
Please help if you have a solution on what I can do with the blank date fields! Thank you so much in advance.
3 4698 nico5038 3,080
Recognized Expert Specialist
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 has a text based Date field!! Unbelievable.
This causes my Crystal Report a bunch of problems as I have to convert the date text data to date and compare it to the user inputted date to find records between the inputted dates. All would be swell if some of the entries were not blank!
Here's what I have when the user runs a filter and filters a date:
sQuery = "CDATE({tablena me.datefield}) >= CDATE('01/01/2008')";
CrystalReportvi ewer1.Selection Formula = sQuery;
CrystalReportvi ewer1.RefreshRe port();
It works fine if the date is not empty and I've tried to tell the Report "Convert Database Null Values to Default" but all that nets me is an error message of
"Bad Date Format String" because of the blank field trying to be converted. It appears the Convert Database Null Values does not work, or is not helpful at all on this end.
Please help if you have a solution on what I can do with the blank date fields! Thank you so much in advance.
Perhaps best to create a query (qryX) in Access using the NZ() function like: -
select *, IIF(IsNull([Datefield]),Date(),CDate([Datefield])) as DateConverted from tblX
-
Now Crystal can point to the query and use [DateConverted] from qryX
Nic;o)
Nico! You are godsend, thank you so much! I made a slight variation to your code as I found out I was getting "#Error!" thanks to the blank date fields. Apparently the field does not allow "null" and the fields were not null they were just blank? No character spacing..I have no idea, but anyway instead of doing "IIF(IsNull ", I wrote IIF([DateField]=''). Works like a charm now, thank you soo much!
nico5038 3,080
Recognized Expert Specialist
Glad I could help and success with your application !
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Megan |
last post by:
quick summary: i'm having problems trying to group fields in a report
in order to calculate percentages. to calculate percentages, i'm
comparing the results from my grouped fields to the totals.
first, let me say that this is a really long post. i wasn't sure how
much information/ background to provide, so i thought more was better
than less. i tried to delineate certain areas so that it would be
easy to peruse my posting and find...
|
by: Chris |
last post by:
I have the following situation in a VB.Net App I am working on:
1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003.
2.)The datasource for the report is a Stored Proc in a SQL Server DB (pull
method).
3.)The Stored Proc has two input parameters of type date.
4.)The Stored Proc is a rather complex proc that was not written by me, but
does work(see next item). It currently returns about 13K rows of data.
5.)The...
|
by: Marc Castrechini |
last post by:
We have recently setup a new server:
Windows 2003 (Version 5.2)
IIS 6.0
ASP.NET 2.0
Using existing code that previously worked we can't seem to export PDFs from
our Crystal reports anymore (exception below). From past problems we know
the exception typically means that the export destination does not have the
proper security permissions. Normally you have to add NETWORK SERVICE with
permissions but we use Windows Authentication with...
|
by: Simone |
last post by:
Hello
Here is my issue, I created a crystal report using a data set from my
xsd. Then I created a page with the crystal report viewer control and
bound the report to it.
When I try to view the report on the browser I get a logon page even
though my dataset has a connection string saved within it. When I
preview the data in the dataset I see it no problem. however the
report doesn't seem to know that the dataset is there or that the
|
by: amiga500 |
last post by:
Hello,
I am developing a crystal report called Expense Report (I am not an
expert Crystal Report designer) if someone could help me in this
problem I would be greatly appreciate it. The report would be as
follows:
Description Sun Mon
| |
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
|
by: G. Stoynev |
last post by:
I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.
Here's the formula (DateTransferred is a DateTime column):
If IsNull({MyReportDataSet.DateTransferred}) Then
" " //empty string
Else
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
" " //also pring an empty string - 1/1/1900 means "no date was
|
by: eschneider |
last post by:
I have a webservice which every time I build it keeps adding Crystal
references into the web.config?
<add assembly="CrystalDecisions.Shared, Version=10.2.3600.0,
Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0,
Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
And No, I do not have any references to crystal when I look at project
|
by: Priyam Ganguly |
last post by:
Hello everyone,
I hav been facing a problem since a few days. I'm using crystal report with vb.net 2005 (.Net framework 2.0). In a report I'm retrieving the values from a database table and showing it. But the problem is that if a certain field is blank in database then it's showing a complete blank white field in the report also. This is what I don't want. For example- suppose there's a field in datbase named EntryDate which is not mandatory....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |