Two dates difference in SpagoBI Studio javascript code? - spagobi

I want to know the format to get the number of days between two dates in spagoBI studio?
I have StartDate and EndDate and I want to know the Number of days between these dates.

The first question to ask is what type of document are you creating in SpagoBI studio? Is it a BIRT or Jasper Report? It is a chart ? Almost everything coming in from a SpagoBI dataset is treated as a String.
If you were using JavaScript in a BIRT report, you would need to covert those ENDDATE And STARTDATE row values to equivalent JavaScript date objects before performing calculations .
What about modifying the dataset query to perform the date difference in SQL and pass that back as a column?

Related

Formatting a date column in powerpointwriter

I am using PowerpointWriter to populate a ppt table. I have currency and date columns that need to be formatted (not with colors/fonts/etc). For example, the date column needs to be the date only, not the time.
How do I do this?
Thanks,
Cheri
PowerPointWriter does not support that kind of formatting at the moment. You should consider formatting your data in your application before binding the data to the PowerPoint file using PowerPointWriter..

Can't return records in Crystal using Crystal Report Date Range and an Oracle DateTime field

I may be going about this all wrong, which is why I am reaching out. I have a Crystal Report that uses an Oracle database as a source of data. I wrote a command to grab the needed records from the database. Then I am using two Crystal Report Date parameters to create a range. The date that I am checking for existence within the range in my Record Selection is an Oracle date, which is showing up as a date time. I have tried using CDate, CStr, and Date but I cannot get data to display. Now if I remove the parameters, I can see data. But they need to be able to use the range. Is this "truly" possible??

How can I get a date entered in a VB6 application to display on a Crystal report?

I have a VB6 application where a user inputs a date range and the dates are used to populate a Crystal 8.5 report using a selection formula within the VB6 code. I need to display the date the user selected on the report. Since the date is technically not a parameter, I am not sure what I can put within the field object/formula field to get the date from the application. Any and all help would be greatly appreciated!

SSRS: How to add Calendar Dates in Columns (tsql)

I've got the needed query to extract what data I need, but I'm having issues on how to manipulate them in Visual Studio 2008 and/or Report Builder 3.0.
I want to add the calendar days of the month as a column horizontally in SSRS and I've tried many different ways but still unable to accomplish what I need.
Here's basically what I'm trying to accomplish. Any help would be greatly appreciated:
Modify your original dataset query to include an right outer join to a dimension table, linking your completion date to a date field within your dimension table, for example your sql query should include something like:
FROM tbl_referrals RIGHT OUTER JOIN
Dim ON tbl_referrals.AdmitDate = Dim.Date
and then use dim.date as column group.
If your dimension table also includes years,months these can further filtered accordingly to the days of the months you require.

Oracle SQL Output to Excel - Date format issue

I ran an SQL Query for Oracle which consists of Invoice date and Check date. When these data are copied on to an Excel Spreadsheet as text, it's dispayed as ex: "13-10-31" (Oct 31, 2013). However, when converted to date format, it's displayed as "10/13/1931". I've tried different date types but it always recognizes as the first part of the text as the day, then month, then year. I need these values to be setup as a date format as I need to calculate Days Payable Outstanding and other related ratios.
Is there any way to convert these values so that Excel recognizes the day, month, and year correctly? Would there be a macro that could automate this process for existing data and data that will be added in the future?
Thank you in advance.
Firstly, I hope the data type of your date column is DATE.
Secondly, the date should always have year as YYYY and not just YY. The world has already learned from Y2K bug.
If above two points are met, then while displaying use to_char(date_column, 'mm/dd/yyyy'). Thus, with YYYY format, there won't be any confusion between year and other fields.

Resources