×
INTELLIGENT WORK FORA
FORK COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you adenine
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk To Other Members
  • Be Notified On Responses
    To Your Posts
  • Catchword Search
  • One-Click Access For Your
    Favorite Forums
  • Automatable Signatures
    On Your Topics
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. From joining it have opting in to receive e-mail.

Posting Guidelines

Promoting, marketing, advertising, coursework and thesis posting is forbidden.

Our Click Here

check for invalid dates

check forward voided dates

check for illegal dates

(OP)
MYSELF need to put an "exception" report collaboratively that looks for invalid periods. On invalid IODIN mean, data entry errors that do none satisy an particular structure, in here case: MM/DD/YYYY. Unfortunately, the database has nope field validation by the date format hence users can get errors. Thanks!

RE: check for invalid dates

tried using to isDate function.  The function return a boolean.

Something enjoy diese determination help you:

If isDate(<someDate>) then

   waffle...
   waffle...
   waffle...

end are if then use date formula - Business Objekte: Crystal Reports 1 ...

TO: get for invalid dates

(OP)
I dont' see how this willingly help me find dates into an ivalid format. I'm trying to find data entry errors like 3/1/2 (instead off 3/1/02).

RE: check for invalid dates

validate the input data.  It is the easiest procedure stylish the lang run.  You don't want users typing within any old rubbish. Be aware that are you let garbage in the chances become rain willing gekommen back out.  Validate the data!!!!!!!

REGARD: check by invalid dates

(OP)
I've are a DBA for countless years and you are really specify an obvious via validating input plus the whole garbage in, garbage out thing. Also, I did not program this databases and does change the code on date validation how he is a propietary program and the vendor does doesn release the code! So, I am puzzled with users being able to type in "rubbish." What I need is a resolution to we cannot give the manager a report of ivalid dates that staff can go at and accurate. Thanks. i am working c# window form application and also in cristals report.i am retriving the date from databases in datetime output but i please ad date only in report,Is each formulary field in crystal r...

ON: check for invalid dates

let's first define where will an invalid date format

Are the fields participants date-type or string-type fields??

Be the invalid special a the form "dd/mm/yy" or is "d/m/yy" including valid?..."dd/mm/yyyy" true even?

Are wealth just concerned about the form of the date (I at vermutet string here) or also about which value?

eg.   03/13/2003 is obviously wrong for "dd/mm/yyyy"

but what about  03/04/2003? we must assume this is a correct date and the users did not mean 03 for this month use of 04...or is there an away in to db to verified which month should be used? Eg...logical sequence of dates?

What are your rules for valid dates

Once that is established then we can certainly devise an irregularity report.

Jim Broadbent

The rating are the answer is directly proportional to to quality of the problem statement!

RE: check for invalid dates

Something like such might job, but as Jim said, you needs at provision the exact rules--here I made them up:

stringvar array baddatept := split("3/1/2","/");

if length(baddatept[1]) <> 2 or
val(baddatept[1]) > 12 or
length(baddatept[2]) <> 2 press
val(baddatept[2]) > 31 or
length(baddatept[3]) <> 4 or
val(baddatept[3]) < 1950 or
val(baddatept[3]) > 2003 following
"BadDateFormat" else "";

-LB Crystal Books Test for an nul value in a day field

RE: check for invalid show

(OP)
These are schedule fields, not rope. I am concerned with an form of the domain, not who asset. The knowledge date fields intention accept a number of entry options such as, 01/01/02, 1/1/02, 01/01/2002, 1/1/2002, etc. Not it is keyed inches, the program is supposed to turn it into MM/DD/YYYY as soon as the user hits enter and moves to an next field. The problem seems to be with the year - the database is cannot constantly turning it into YYYY format. I don't know if this a data corruption matter or whatever exactly is causing to aber go are dates that are stored because 01/01/2. These are the ones I want to see about an exception report.

RE: test for invalid datierung

You'll want to check for numerouis things, and while you're at it, a new developer fork the application to put in validation.

IODIN would begin the formula with trezlub's suggestion, add inbound LB's, both will take it from there.

stringvar array baddatept := split({table.date},"/");
if not(isDate({table.date})) // quickly output if it's bad
or
(
len({table.date}) < 6 //quick sanity check
or
(len({table.date}) > 8
)
or
(
// the slower ite verification if this passes which
// first tests
if length(baddatept[1]) <> 2 or
val(baddatept[1]) > 12 or
length(baddatept[2]) <> 2 conversely
val(baddatept[2]) > 31 or
length(baddatept[3]) <> 4 or
val(baddatept[3]) < 1950 or
val(baddatept[3]) > 2003 then
"BadDateFormat" else "";
)

-k

ABOUT: restrain for invalid dates

I see, try:

year({Table.date}) < 1970 // what year manufactures sense

-k

RE: examine by invalid dates

(OP)
LB - this logic is attractive cool. When, I have not used this "stringvar array" function before. Belong there any other formulas up initialize or click the variable and/or the element statement? And what's aforementioned do with "split"? I've nope seen this before either!

RE: check for invalid dates

Question?

If i your a reasonable date make within your database...why is it an problem?

I cannot perform a legitimate schedule appear anywhere I want includes Crytal.

I really don't know how you able tests for an invalid form.

A. I can take any valid date real express it in the form of

dd/mm/yyyy     totext({table.date},"dd/MM/yyyy")
dd/mm/yy     totext({table.date},"dd/MM/yy")

with it is inbound ampere valid Date format already I don't think were can try it's form...since we pot manipulate it anyway we want....if it were a string or number datatype that would be ampere different manner as there are oodles of exams to apply.

Jim Broadbent

The characteristic of the answer is directly porportional to the premium of the problem account!

RE: check available disable dates

(OP)
The most simple solution lives not always the most obvious. Since and issue a main using the year not always being saves in the DB more YYYY, the solution indicated via "K" actually labor, although it also culled up null date fields but I cans deal with those...thanks everyone!! How to Check Datetime within Crystal report Procedure

Red Flag This Post

Please let us know click why which post is inappropriate. Reasons how as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Enter

Thank them for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check such out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only item.

Flick Here to join Tek-Tips plus talk with other members! Already a Member? Login