Question

Wildcard in Date Prompts

Asked by: pvsbandi

Hi,
  My requirment is to enter dates for start date and end date prompts and if i enter a wild card, should bring back all data.I have pasted what i'm trying to do.But it's not parsing OK.
  Please help me get it right.

Thanks!
 

(DATE(@Select(Kit\Kit Creation Date)) BETWEEN  DATE(@Prompt('1 Kit Version Start Date','A',,MONO,FREE))  AND DATE(@Prompt('2 Kit Version End Date ','A',,Mono,FREE))) 
OR ( '*' IN (@Prompt('1 Kit Version Start Date','A',,MONO,FREE)  AND '*' IN @Prompt('2 Kit Version End Date ','A',,Mono,FREE))
                                  
1:
2:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-25 at 09:29:48ID24680449
Tags

Business Objects XI R2

,

DB2

Topics

Business Objects

,

Databases Miscellaneous

Participating Experts
6
Points
500
Comments
30

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Batch file for wild cards in RD command?
    I inherited a file syncronisation system which adds a tag of ".pstmp" to certain directories every day. Within a short period of time you end up with directory names which are 28973287328973 characters long and unusable by most software eg day1 hello.pstmp day2 hel...
  2. Xcacls.vbs  wild cards to search directories
    Hi I'm trying to change the NTFS permissions on specific files with the same name that appear in a large number of different directories. Individually naming the directory is not an option as new ones are added all the time. I can use wildcards * for file names ok, but actu...
  3. wild card
    Hello, I need to use a wild card for the map number in the javascript, i have map1,map2,map3 etc tH+='<table class="p7GSfst" align="center" cellpadding="0" cellspacing="0" USEMAP="#map*\">'; USEMAP="#map*\"...
  4. how to wild card search
    Delphi what does it mean by wild card search Does it similar to show all the items? or does it similar to one of the feature of the google search "feeling lucky today"? can anyone show me some examples, How to implement it?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: jimpenPosted on 2009-08-25 at 17:12:05ID: 25183458

There is no really easy way to do it.

Why not just do 5/5/55 to 2/2/22? It should bring back from 1955 to 2022.

 

by: pvsbandiPosted on 2009-08-26 at 05:36:13ID: 25186844

Thanks,
  But then it must be able to switch from one condition to the other, right?
 your suggestion will bring everything regardless of what we enter in the prompt, right?

 

by: mwvisa1Posted on 2009-08-26 at 06:13:46ID: 25187179

I think Jim was suggesting to enter those values when prompted.  Utilizes what you have in place already but sends a range that should encompass all your data.

 

by: mwvisa1Posted on 2009-08-26 at 06:16:10ID: 25187194

However, you can try this as an alternative as you would need to check for the * first, otherwise you will try to convert an incorrect date and get errors.

( '*' IN (@Prompt('1 Kit Version Start Date','A',,MONO,FREE)  AND '*' IN @Prompt('2 Kit Version End Date ','A',,Mono,FREE)) OR (DATE(@Select(Kit\Kit Creation Date)) BETWEEN  DATE(@Prompt('1 Kit Version Start Date','A',,MONO,FREE))  AND DATE(@Prompt('2 Kit Version End Date ','A',,Mono,FREE))) 

                                              
1:

Select allOpen in new window

 

by: mwvisa1Posted on 2009-08-26 at 06:17:49ID: 25187212

And you will most likely want an OR in between the two checks for '*' as if you get only one it will fail the first condition and try to convert one to a date and you will end up with failure again.

 

by: pvsbandiPosted on 2009-08-26 at 09:43:11ID: 25189694

Hi,

 '*' doesn't work because of the datatype mismatch.
 I tried a default date like '1/1/1900' and that works.But again, as you said, this value holds good only when i enter it in both the prompts.If i enter 1/1/1900 for the end date and 8/24/2009 for the start date, doesn't work.Can you suggest any workaround?

Thanks!

(DATE(@Select(Kit\Kit Creation Date)) BETWEEN  DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))  AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))) OR ( DATE('1/1/1900') BETWEEN DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))  AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE)))

                                              
1:

Select allOpen in new window

 

by: jimpenPosted on 2009-08-26 at 09:49:26ID: 25189754

The Between clause, in most flavors of SQL, expects the earliest date first as the first one.

This is a common restriction.

 

by: pvsbandiPosted on 2009-08-26 at 09:55:32ID: 25189807

Yes, but my intention is to get all the values if '1/1/1900' is entered. How can i achieve it?

 

by: mwvisa1Posted on 2009-08-26 at 10:03:19ID: 25189890

Just test the first one then.  And whenever you enter that value in the first that means you want all dates.  Again you have to put that as the first check.

(( DATE('1/1/1900') = DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE)) OR (DATE(@Select(Kit\Kit Creation Date)) BETWEEN  DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE)) AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))))

                                              
1:

Select allOpen in new window

 

by: mwvisa1Posted on 2009-08-26 at 10:04:25ID: 25189898

Type-o:

(( DATE('1/1/1900') = DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))) OR 
(DATE(@Select(Kit\Kit Creation Date)) 
BETWEEN  DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE)) 
AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))))

                                              
1:
2:
3:
4:

Select allOpen in new window

 

by: pvsbandiPosted on 2009-08-26 at 10:27:36ID: 25190089

Thanks, tried that. But i have Kit Creation Date End also.If i try something like this, it gets back all the data regardless of what i type in. Do you see the problem?

(( DATE('1/1/1900') = DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))) OR
(( DATE('1/1/1900') = DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))) OR
(DATE(@Select(Kit\Kit Creation Date))
BETWEEN  DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))
AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))))

 

by: mwvisa1Posted on 2009-08-26 at 10:52:22ID: 25190327

Just use one to flag or put braces around first two logical.

 

by: pvsbandiPosted on 2009-08-26 at 11:08:50ID: 25190494

Won't work, since all are 'OR' conditions. Correct me if i'm wrong.

 

by: CRXIuser2005Posted on 2009-08-26 at 11:09:17ID: 25190502

I just skimmed through this question, but initially...my suggestion would be to create a SEPARATE TABLE in the Database that contains the DATES that you need for the prompt...and use the DB TABLE to populate the PROMPT.

Hope it makes sense....

M

 

by: pvsbandiPosted on 2009-08-26 at 11:18:59ID: 25190597

Thanks! But, can you please explain how that would solve my problem?
   Let me mention to you, my requirement here.
  I have a Date Range "Start Date' And "End Date". If the user enters '1/1/1900' in the start date and '8/24/2009' (just an example) in the end date, it should get all the dates upto '8/24/2009'.
  If i enter '8/24/2009' as start date and '1/1/1900' as end date, it should start from '8/24/2009 and get all the dates in the database that are greater than 8/24/2009.

   1/1/1900 is my wildcard prompt value here.

 

by: CRXIuser2005Posted on 2009-08-26 at 11:29:27ID: 25190702

SO,..... what will the user be inputting a MAJORITY of the time.

Will they be entering a literal "REAL" START DATE...or will they be doing the silly '1/1/1900' in either the START or END date.

 

by: mwvisa1Posted on 2009-08-26 at 11:29:55ID: 25190710

Sorry was on my mobile, was harder to type.

(( DATE('1/1/1900') = DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))) OR
(DATE(@Select(Kit\Kit Creation Date))
BETWEEN  DATE(@Prompt('A- Kit Creation Date Start','A',,MONO,FREE))
AND DATE(@Prompt('B- Kit Creation Date End','A',,MONO,FREE))))

Should work as you are just using to wildcard your data.  Pick a date that is never a valid start date, so when you see '1/1/1900', it doesn't matter what is entered for the second prompt as your logical expression will evaluate as true without ever hitting the date conversion code which is why that has to be first in the list of logical conditions.

if both fields need to be set, then you are basically doing what Jim suggested earlier.  So again I support his thoughts.

What's wrong with just this:
DATE(@Select(Kit\Kit Creation Date)) BETWEEN  DATE(@Prompt('1 Kit Version Start Date','A',,MONO,FREE))  AND DATE(@Prompt('2 Kit Version End Date ','A',,Mono,FREE))

Then just pass in '1/1/1900' and '12/31/2999' into the dates or like Jim showed '5/5/55' and '2/2/22'.

 

by: mwvisa1Posted on 2009-08-26 at 11:31:30ID: 25190731

CRXIuser2005: I see you are here now, so I will leave this to you. :)

 

by: CRXIuser2005Posted on 2009-08-26 at 11:32:58ID: 25190751

Why not have the prompt to DEFAULT to the following:

STARTDATE DEFAULT: 01/01/1900

ENDDATE DEFAULT: 12/31/2099 (or whatever calendar end date the system allow)

And have the user change ONLY the dates needed.....????

 

by: pvsbandiPosted on 2009-08-26 at 11:56:42ID: 25190966

How can we give default dates?  don't know how to do it.

Thanks for your help!

 

by: LinInDenverPosted on 2009-08-26 at 12:08:35ID: 25191098

I like CRXI's idea for a simple solution. If your users do not like this, do you have the option to add additional parameters? It might clarify it for your users.
First Parameter could contain two values: "Return All Data and Ignore Date Range Entered Below" and "Use Date Range Entered Below".

You can have a conditional where clause.

If @Parameter = 1 then Date > 1/1/1900
Else Date between @BeginDate and @EndDate

This will work as long as @BeginDate and @EndDate both have default values (they can be any value, this is just so the user isn't prompted at run time).

I have done this a lot for reports where we will try to make it easier for users to pull standard (MTD, WTD, YTD) but then also give them the option to choose the date range.

Good luck.

 

by: LinInDenverPosted on 2009-08-26 at 12:09:22ID: 25191105

Default Dates are set in your parameter settings.

Right click to Edit Parameter, and there will be a field for "Default Value". This looks a little different in each version of Crystal, but it will be in there somewhere.

 

by: pvsbandiPosted on 2009-08-26 at 12:27:56ID: 25191285

Thanks LinInDenver! I'm working on BOXI R2.But i'll try and see if your idea works here.

 

by: James0628Posted on 2009-08-27 at 05:44:26ID: 25197312

The tests you posted in message 25190089 seem OK logically.  1/1/1900 entered for either the start or end date should give you every date, which may not be what you want, but I don't see any reason why you would get "all the data regardless of what i type in".  Actual dates, like 08/20/09 to 08/25/09, should work.

 If I misunderstood and the problem was actually that 1/1/1900 for either the start or end date was giving you every date, and you wanted 1/1/1900 for the start date to mean no start date and 1/1/1900 for the end date to mean no end date, you should be able to change the tests to handle that.

 Are those your only tests, or are there others (other parameters or other fields that you're checking)?  If there are other tests, then there could be problems if the tests are not combined properly, but, offhand, I'd expect a problem like that to exclude records, not include extra records.

 James

 

by: pvsbandiPosted on 2009-08-27 at 09:18:54ID: 25199942

Thanks James! Upon rethinking about the prompts, i settled down with the idea that Jimpen gave in the first post,which is typing 1/1/1900 as start date and 12/31/2050 as enddate. This works fine but, has a problem too.There are no date entries on some rows,meaning they are all blanks.
 For this situation ,i couldn't bring back those rows. Can anyone suggest a workaround for this?

Thanks everyone,for all the help!

 

by: CRXIuser2005Posted on 2009-08-27 at 09:26:51ID: 25200026

Well, I think you have an issue then.

You have to tell the report what a "Blank" date represents. IF you want a blank date to NOT appear in the report, then you'll need to filter the blanks out within the report itself or the Query itself.

IF you want the "blank" Date to represent an actual date, I think the best way to do that is to create a new field object that converts "blanks" into a specific DATE and then use the new object for your prompt.

Just shooting from the hip here....hope it helps.
M

 

by: pvsbandiPosted on 2009-08-27 at 09:47:03ID: 25200250

That's a nice Idea!! Thanks CRXIuser2005! Let me try that idea.I have a bunch of dates that need to be changed.
 Will keep you posted.

Thanks!

 

by: mlmccPosted on 2009-08-27 at 10:25:38ID: 25200660

In the select exprt you can use

IsNull({DateField})
OR  
({DateField} >= {?StartDate} AND  {DateField} <= {?EndDate}

mlmcc

 

by: pvsbandiPosted on 2009-08-27 at 12:28:46ID: 25201731

That's a great idea again! Thanks much! I'm having it implemented.

 

by: pvsbandiPosted on 2009-08-27 at 12:40:02ID: 31620263

Thank you all!
All of you were very kind to me.But i can give points to only some of you.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...