General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old September 14th, 2004, 04:39 PM
KathyW KathyW is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 KathyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation DateTime to Date with Crystal Reports/ Interbase

I am using Crystal Reports and am trying to convert a datetime field to a date field during the select statement as I want to be able to search between two user defined parameters

My SQL reads

SELECT "ES_EVENT"."EVENTUID", "ES_EVENT"."CREATED"
FROM "ES_EVENT" "ES_EVENT"
WHERE ("ES_EVENT"."CREATED">={?dtBegin} AND "ES_EVENT"."CREATED" <={?dtEnd})


"ES_EVENT"."CREATED" is the DateTime field and I want the parameter dtBegin and dtEnd to be date only so the user does not have to specifiy the time.....alternately I could look at converting the date parameters to date time...any thoughts

Last edited by KathyW : September 14th, 2004 at 04:41 PM. Reason: Spelling Error

Reply With Quote
  #2  
Old September 15th, 2004, 05:04 PM
rajitha_kba rajitha_kba is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 rajitha_kba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink Try this

Quote:
Originally Posted by KathyW
I am using Crystal Reports and am trying to convert a datetime field to a date field during the select statement as I want to be able to search between two user defined parameters

My SQL reads

SELECT "ES_EVENT"."EVENTUID", "ES_EVENT"."CREATED"
FROM "ES_EVENT" "ES_EVENT"
WHERE ("ES_EVENT"."CREATED">={?dtBegin} AND "ES_EVENT"."CREATED" <={?dtEnd})


"ES_EVENT"."CREATED" is the DateTime field and I want the parameter dtBegin and dtEnd to be date only so the user does not have to specifiy the time.....alternately I could look at converting the date parameters to date time...any thoughts
--------------------------------------
Please Try this
Your dtBegin and dtEnd fields are DATE type so you want to convert it to DateTime, which has to be recognize by SQL Server?
If I'm correct, b4 passing the dtBegin and dtEnd to youe SELECT statement, try to convert in to DataTime using SQL CONVERT function. Ex: CONVERT (datetime, dtBegin, 103) to another temp datetime typr variable.
103 means : dd/mm/yy

Please let me know, how did u go

Raj

Reply With Quote
  #3  
Old October 7th, 2004, 04:04 PM
KathyW KathyW is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 KathyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for that

I managed to find a solution by creating the following user defined formula in the Select Expert function of the report within the report itself :
{Command.CREATED} in DateTime (DatePart("yyyy",{?Report_Start_Date}), DatePart("m",{?Report_Start_Date}), DatePart("d",{?Report_Start_Date}), 00, 00, 01) to DateTime (DatePart("yyyy",{?Report_End_Date}), DatePart("m",{?Report_End_Date}), DatePart("d",{?Report_End_Date}), 23, 59, 59)

Reply With Quote
  #4  
Old June 8th, 2005, 05:27 AM
request request is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 request User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 39 sec
Reputation Power: 0
passing parameters to stored procedure thru crystal reports by taking add command

Hi All
I am trying to create crystal reports. In this concern i have created a command which execute a stored procedure. This stored procedure takes three parameters which in turn i want to pass it from .aspx page. when i click on button parameters should pass to that stored procedure.
for example

exec sp_example @date='{?selecteddate}'

here date (varchar in stored procedure) and selected date (string type i selected) whenever i am adding this command in add command (which is there field explorer -> database fields) it's saying failed to open a row set.

syntax error for converting datetime to string.

if you have any idea please do reply.

Regards
request.

Reply With Quote
  #5  
Old March 2nd, 2008, 01:21 PM
dmmartinez dmmartinez is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 dmmartinez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 13 sec
Reputation Power: 0
Trying your solution with no luck, Can you help?

Quote:
Originally Posted by KathyW
Thanks for that

I managed to find a solution by creating the following user defined formula in the Select Expert function of the report within the report itself :
{Command.CREATED} in DateTime (DatePart("yyyy",{?Report_Start_Date}), DatePart("m",{?Report_Start_Date}), DatePart("d",{?Report_Start_Date}), 00, 00, 01) to DateTime (DatePart("yyyy",{?Report_End_Date}), DatePart("m",{?Report_End_Date}), DatePart("d",{?Report_End_Date}), 23, 59, 59)


Kathy, can you give any more details on how you solved the date time issue, I want to only give the option of date to the end user just like you. Any more details would help a great deal.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > DateTime to Date with Crystal Reports/ Interbase


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway