Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I combine a DATE Field with a TIME Field to form a DateTime field in Crystal Reports XI?

Posted on 2008-11-14
7
Medium Priority
?
1,787 Views
Last Modified: 2013-11-15
How do I combine a MULTIPLE DATE Field with a TIME Field to form a DateTime field in Crystal Reports XI?

My date field is broken up into year, month, day.  The data is the year field is 7 for 2007, 8 for 2008.  The day is 1,2,3,etc.  The month is 1,2,3,etc. Then I have a time field which is military time, in another field.  I need to be able to subtract DISCHARGE DATE (3 fields) and DISCHARGE TIME (1 military time field) from ADMIT DATE and ADMIT TIME (same format).  

I can do this in Crystal or Excel, I just need it!  Can anyone help!????
0
Comment
Question by:Becky Edwards
  • 4
  • 3
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 22962596
You can create the datetime like this

Add a formula
DateTime(Date(2000+{YearField},MonthField,DayField,{TimeField})

If that doesn't work give an example of the fields

mlmcc
0
 

Author Comment

by:Becky Edwards
ID: 22963092
I tried your suggestion(see below). Perhaps I didn't quite understand. Error msg said "Wasn't a formula"
DateTime(Date(2000+{BADPLPP.LPADT3},{BADPLPP.LPADT1},{BADPLPP.LPADT2}{BADPLPP.LPLAT}))

Where LPADT3 is Year
LPADT1 is Month
LPATD2 is Day
LPLAT is Time

if you browse data in these fields you will find:
LPADT3 is 8
LPADT2 is 11
LPADT3 is 14
LPLAT is 2359 (the time in military hours)
if i were to make theDate ToText it would look like this "11/14/2008" but I would have to format it like so:
ToText ({BADPLPP.LPADT1},'00')&'/'&ToText({BADPLPP.LPADT2},"00")&'/'&ToText({BADPLPP.LPADT3},"00")
0
 

Author Comment

by:Becky Edwards
ID: 22963113
Please Help!!!!!  That particular one did not work, so I am still up in the air on this one.  Thank you.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 101

Expert Comment

by:mlmcc
ID: 22963346
You'll have to do it this way

DateTime(Date(2000+{BADPLPP.LPADT3},{BADPLPP.LPADT1},{BADPLPP.LPADT2}),
                Time({BADPLPP.LPLAT})\100,{BADPLPP.LPLAT}) MOD 100,00) )

mlmcc
0
 

Author Comment

by:Becky Edwards
ID: 22963737
It says "The remaining text does not appear to be part of the formula" and ,00)) is highlighted.
DateTime(Date(2000+{BADPLPP.LPADT3},{BADPLPP.LPADT1},{BADPLPP.LPADT2}),Time({BADPLPP.LPLAT})\100,{BADPLPP.LPLAT})MOD 100,00))

0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 22964502
Extra )'s

DateTime(Date(2000+{BADPLPP.LPADT3},{BADPLPP.LPADT1},{BADPLPP.LPADT2}),
                Time({BADPLPP.LPLAT}\100,{BADPLPP.LPLAT} MOD 100,00) )

mlmcc
0
 

Author Closing Comment

by:Becky Edwards
ID: 31516856
Thank you So MUCH!  It worked.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question