How can I change a custom date into numbers in Google spreadsheet? - google-apps-script

I want to do a vlookup/sumif based on dates
How can I do it? I saw from a source I have to first change it into numbers
Somehow I cannot do it with formulas like value/Datevalue, I can only convert it by changing its format.
Spreadsheet image

The vlookup() and sumif() functions work fine with dates and date time values.
With vlookup(), you can get an exact match of a date time value by setting the is_sorted parameter to false. To match the first value that is less than or equal to a date time, make sure that the data range is sorted, and set that parameter to true.
With sumif(), if you need to remove the time component from a date time value to match dates to date times, use datevalue().
See this answer for an explanation of how dates and times work in spreadsheets.

Related

MS Access Calculating date differences if Dates are Short Text

Is is possible in a Table to Calculate differences between Dates if the Value in the field is considered "short text"?
I am working to convert an Excel macro database into Access one and I have imported the data from the Excel file into an Access Table.
however i realized 2 feilds that count up until closure are now just fixed numbers but need to add up as each day passes until closure
when i imported the Dates became Short Text.
is there an expression that would handle this situation?
Each record has a serialized non repeating ID number seperate from access as well.
Dates I have are
OfficialissuanceDate,
DatePlanSubmitted,
DatePlanCompletedSubmitted,
DateClosed,
I need 2 calculations that increments daily when DateplanSubmitted and DatePlanCompletedSubmitted are null
Both comparing to OfficialIssuanceDate. then stop counting when they are no longer null. (have a date in updated to the record) and retain the value.
I have tried to Google calculating Dates but i get DateDiff function which doesnt appear to work. I've used Access and taken a class on it but never really made a new DB from scratch
Dates in a text field are not actual dates, just strings of characters. A Date/Time field stores value as a double number then displays in a date structure - "dd/mm/yyyy" is Access default structure.
Sometimes Access will do implicit conversion of data but not in this case. Either change field type to Date/Time or do conversion with CDate() function. However, you will find that conversion functions error with Null input.
Arithmetic operation with Date/Time field type is possible. However, arithmetic when any term is null returns Null so have to deal with that. One way uses Nz() function: Nz([DateClosed], Date()) - [DateOpened]. Unfortunately, Nz() is not available in table Calculated field type, so do that calc in query or textbox. Most developers avoid table Calculated field type. If you really want to use, expression would have to be: IIf(IsNull([DateClosed), Date(), [DateClosed]) - [DateOpened].

How to calculate the difference between days in a table field

Ok this should be a relatively easy thing to do, yet I'm at the head desk stage trying to figure out the insanity here.
I have a table called tblPersonnel. I'm tracking two document expiration dates in date/time fields called CED and PPED. When I run a query against tblPersonnel I need it to look at PPED, determine if that document is expired and if so use CED instead. I have a few fields in the query that need to use this concept to determine what the output value is, but I am hitting a wall here trying to get the query to spit out the correct value. Here's what I'm using for one of the fields - Document Expiration Date: IIf([PPED]-Now()<0,[CED],[PPED]). What's happening is that the expression is constantly popping as false, so PPED is getting used regardless if it's an expired date or not. Does anyone have any ideas as to what I'm doing wrong here?
I've also tried to set this up as its own field in tblPersonnel, but that's even more aggravating. If I try to set the field to just a text field - IIf([PPED]-Now()<0,"Yes","No"), the formula will accept the use of Now(), but it doesn't like the reference to the other fields in the table. If I set it as a calcuated column, I can reference the other fields but it doesn't like Now(). I'm at a loss here.
If PPED is less than Date(), it is expired. Don't need to subtract. Assuming CED and PPED are just date parts, no time, consider:
IIf([PPED] < Date(), [CED], [PPED])
If PPED could be null:
IIf(Nz([PPED],0) < Date(), [CED], [PPED])
Ok finally fixed it here. I had another issue in that I wasn't accounting for how Access would handle a Null or blank value in PPED. The functioning formula is Document Expiration Date: IIf(Len([PPED])>0,IIf([PPED]<Date(),[CED],[PPED]),[CED]) Thanks to June7 for helping me simplify the expression, as I was using DateDiff('d',[PPED],Date())<0 but their answer is just so much cleaner and quicker to type.

Conditional formatting for column of dates

I have a date column. I want to highlight each date that is 90 days old or older in Column "C". For single cells it's easy using Date is before, exact date, and then:
=TODAY()-90
but for the entire column I struggle to find how to insert the function so it keeps working for all cells. I tried something like Date is before, exact date, and:
=ARRAYFORMULA(TODAY()-90>C2:C200))
Sadly, this does not work. Any suggestions?
Please try:
=and(today()-C1>90,C1<>"")
as "Custom formula is" with formatting of your choice and Range: C:C (or to suit).
The 'engine' is today()-C1>90 but this is wrapped above in an and so blank cells are not also formatted by the rule.
Applies to New Google Sheets.

SSRS Date Parameters - Setting Date B = Date A whenever Date A is changed

I am looking into a query from one of our users regarding the behaviour of date pickers on their report.
They have asked that when they enter a date in Date Paramater A that this is then duplicated in Date Parameter B.
I can achieve this when the report is first run by given Date Parameter A no default value (so it has to be chosen by the user) and seet Date Parameter B's default value via an expression to "=Parameters!StartDate.Value".
The question though is wether or not I can recreate this when Parameter A is updated. Therefore if they run the report once and then decide they need to choose another date. Can I set Date Parameter B to refresh each time Date Parameter A is changed?
E.G
Report is opened
Date Parameter A is set to 02/12/2013.
Date Parameter B now defaults to 02/12/2013.
Search is performed
A second search is required so, without closing the report the user changes the date in Date Parameter A
Date Parameter A is now set to 05/12/2013
Date Paramater B still says 02/12/2013 - can I somehow make this auto refresh to match Date Parameter A if Date Parameter A changes?
EDIT: Thanks to Kalim for pointing this out but it must also be noted that although I would like Date Parameter B to default to the new value selected by Date Parameter A, dates greater than that selected for Date Parameter A must also be available in case they wish to widen the range of dates.
Hopefully that is clear, but if any further information is required then please let me know.
Thanks in advance for your time and help.
You should be able to set the "Available Values" to the value of the first date parameter.
Select "Available Values" then select the "Specify values" option. Add a value and edit the expression of the value. Set this to the same expression you used in your default value expression.
Hope that makes sense!
Screenshot:

Drill Down on a Zero Value in an SSRS Bar Chart

I have a bar chart in SSRS that does legitimately produce zero values. Is it possible in SSRS to drill down on the zero values like you can with non-zero values? The action on the data series works great for all values other than zero.
What about a range chart? The range chart takes dates as values, so depending on how your data is grouped as long as they have a date associatead with it they will map out and then you can drill through. You might even be able to add dates yourself.
The only thing you have to watch out for it that the range chart takes in a range of dates so you need two. But you can always do a dateadd aggregate function to produce another column and that could be your second date value.
Let me know if this helps, Cheers!
The zero values still have a clickable link, it's right on the axis (or at zero). Not easy to find or to click but it does work.