How to get total and current numbers of Google Workspace Business Starter licenses using customerUsageReports.get - google-apis-explorer

Please tell me how to get total and current numbers of Google Workspace Business Starter licenses using customerUsageReports.get (https://developers.google.com/admin-sdk/reports/reference/rest/v1/customerUsageReports/get). When I request accounts:gsuite_unlimited_total_licenses or any kind of license (https://developers.google.com/admin-sdk/reports/v1/appendix/usage/customer/accounts) I always get an empty report.

You are a legend mate!
The reason you get no response is because usage report is huge and takes time to generate, therefor is about 2 days behind.
So simply, use the "date" parameter to be atleast 2 days back from the day you run the report.
GET https://admin.googleapis.com/admin/reports/v1/usage/dates/{date}
That would be the following format
Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd.
We recommend you use your account's time zone for this.
Reference : https://developers.google.com/admin-sdk/reports/reference/rest/v1/customerUsageReports/get

Related

Microsoft Report Builder - Need to convert Charge Posted Period to previous month

I am new to Report Builder and do not have all of the fields that I usually would have. I have a report that the filter currently is set to Charge Posted Period = 7 and Charge Posted Period = 2021. I need to find a way to convert the Charge Posted Period to look to the last period/month so I can schedule the report to run. I have tried multiple queries and functions which did not work. enter image description here
Has anyone worked with this report builder and can guide me to correct this filter?
Note: The field Charge Posted Period is not a Date type field, I believe it is an aggregate type field.
I would make the query for the Period parameter to be based on the year selected. Then your drop-down would only contain periods in that year.
SELECT [Charge Posted Period] AS AVAILABLE_VALUES,
MAX([Charge Posted Period])OVER() AS DEFAULT_VALUES
FROM TABLE
WHERE [Charge Posted Year] = #ChargePostedYear

Google Forms createResponse with date decrements the day by 1

I am programmatically generating new form responses from rows of data in a Google Sheet (one approval workflow system generates new approval requests in a second approval workflow system). The data includes dates. My script takes the date value as a string from a cell, converts it into a native JavaScript date object, then submits this to a new form response using createResponse(). Here's the pertinent code:
var startDate = googleFormsDateStringToDate(eventDetails['Event Start Date']);
var r = item.createResponse(startDate);
For the most part, the system works robustly. Except for one intriguing problem - for any date after 29/04/2020, the date stored in the response is decremented by 1 day. Any date on or before this date works as expected, any date after is decremented by a day.
I have tried a few things.
The dates correspond to a start date and end date for an event. If the start date is before this date and the end date after, the end date will be decremented whilst the start date is recorded accurately. So I am certain the issue is directly related to whether the date I am submitting falls before or after this date.
I have tested extensively and am absolutely certain that the string-date conversion is working. If I retrieve the value of the response immediately after creating it (before the form response is even submitted), I find that it has been decremented:
var startDate = dateStringToDate(eventDetails['Event Start Date']);
Logger.log(startDate.toString()); // startDate is always accurate
var r = item.createResponse(startDate);
Logger.log(r.getResponse()); // if after 29/04/2020, will be decremented by 1 day
This tells me the issue is occurring precisely when I create the response and that it is occurring "at Google's end".
One of my suspicions is that it may be a timezone issue, but that would not explain why the issue is linked directly to this specific date. My other suspicion is that it may be to do with the fact that 2020 is a leap year, so we get 29/02/2020, and the date after which the error occurs is 29/03/2020. Perhaps somewhere behind Google's implementation of createResponse it is failing to account for the leap year?
Until I can identify the error, I plan to implement a workaround in which I will use getResponse() to check if the response date matches the intended date and correct accordingly. But I would prefer to understand what is causing the error (so I know if it is a bug requiring reporting, or simply my lack of understanding) and, if possible, find a solution.
So, specific questions: What is the source of the error? Is there a solution (rather than a workaround)?
EDIT
Whilst figuring out a workaround, I have answered my first question. In the UK, daylight savings time starts on 29/04/2020. Since the dates entered via the Google Form have no time associated with them, the time appears to be stored as 00:00:00, or midnight. I assume that what is happening is that the adjustment for daylight savings time (1 hour) is subtracting an hour from this time, thereby rolling it back to the day before.
My final question stands: is there a means to reliably prevent this error from occurring rather than manually checking for inaccurate dates (or programming in daylight savings time dates)?

Can't get the Today() function to work properly in MS Access 2016 Custom Web App

I'm trying to setup a query that will show me all of the records in a particular table where the listed expiry date is either in the past or upcoming in the next 6 months (approximately).
At the moment, I have the "Expiry" field added to my query and the 'Criteria' as .
When I try to save the query, I get the following message:
Access can't evaluate an expression or convert data because data types aren't compatible with each other.
TECHNICAL DETAILS
Correlation ID: ae68949d-3041-3000-0984-71635f8fd670
Date and Time: 7/28/2016 6:54:34 PM
I've tried searching the web for a solution, but most websites refer to the Date() function that doesn't seem to be available in the Access 2016 Custom Web App. When I take out the "+180", it works fine but obviously doesn't give me what I need.
Any help would be appreciated.
=============================
UPDATE:
Some users have asked for my SQL and Table Design details. I don't seem to have any way of accessing the SQL View (the option doesn't appear), but here's a copy of my table view:
Access Query Table Design
In the table, 'Active' is a Yes/No field and 'Expiry' is Date/Time.
Try
< DateAdd(Day, 180, Today())
as criteria.
According to https://msdn.microsoft.com/en-us/library/office/jj249452.aspx this should work in a custom web app.
Error says that you have two different date types and they can't be compared. so, as the Today() returns only the Date with 12:00 pm, I can guess that your other "Expiry" Field is a datetime type. So, you can do either: use Format function to convert datetime to date like this
Format([2/22/2012 12:00 PM],"dd/mm/yyyy")
or use Now() function which returns datetime,
or Share your Code :)

Replacement for datepicker in TV OS

UIDate picker is unavailable in TVOS. How to select date and time is there any alternative to select date and time.
This answer focus on Swift - however, similar methods are available in Objective-C.
Since Apple does not provide a date picker for tvOS, there is no standard solution.
However, some possible steps would be:
Design and implement a UI for manipulating the date components (= year, month, day, hour, minute).
Keep track of the currently selected date, e.g. using a stored property. A date label can be updated using property observers (e.g.
didSet).
Implement methods for manipulating the selected date - component by component - and connect them to the UI.
Remember that dates and date calculations are complicated(!), so use the provided date concepts and methods - have a look at Calendar and DateComponents in the documentation.
There, you will find useful methods, for example:
range(of: Calendar.Component, in: Calendar.Component, for: Date)
can be used to find the number of months in a year, days in a month
(and so on).
dateComponents(Set<Calendar.Component>, from: Date) and date(from:
DateComponents) can be used to convert from dates to date components
and vice versa.
Further, isValidDate(in: Calendar) can be useful to check that date
components form a valid date in a certain calendar.
Below is a link to the user interface (with UISegmentedControls) that I developed for my app, however, other solutions are possible.
User interface with segmented controls.
In my case, the date picker is presented modally after selecting a table view cell in an input form.

Access data conversion issue

I'm using Access 2003. Have a table with some date values in a text data column like this;
May-97
Jun-99
Jun-00
Sep-02
Jan-04
I need to convert them to proper date format and into another Date/time column, So create a new Date/Time columns and just updated the values from the Text column into this new column. At first it looked fine, except for years after the year 2000. The new columns converted the dates as follows;
May-97 > 01/05/1997
Jun-99 > 01/06/1999
Jun-00 > 01/06/2000
Sep-02 > 01/09/2010
Jan-04 > 01/01/2010
As you can see any data with year after 2000 get converted to 2010. The same thing happens if I query the data using FORMAT(dateString, "dd/mm/yyyy").
Any ideas why this is so? Do I have to split the month and year and combine them again?
Thanks
Access/Jet/ACE (and many other Windows components) use a window for interpreting 2-digit years. For 00 to 29, it's assumed to be 2000-2029, and for 30-99, 1930-1999. This was put in place to address Y2K compatibility issues sometime in the 1997-98 time frame.
I do not allow 2-digit year input anywhere in any of my apps. Because of that, I don't have to have any code to interpret what is intended by the user (which could conceivably make mistakes).
This also points up the issue of the independence of display format and data storage with Jet/ACE date values. The storage is as a double, with the integer part indicating the day since 12/30/1899 and the decimal part the time portion within the day. Any date you enter is going to be stored as only one number.
If you input an incomplete date (i.e., with no century explicitly indicated for the year), your application has to make an assumption as to what the user intends. The 2029 window is one solution to the 2-digit year problem, but in my opinion, it's entirely inappropriate to depend on it because the user can change it in their Control Panel Regional Settings. I don't write any complicated code to verify dates, I just require 4-digit year entry and avoid the problem entirely. I have been doing this since c. 1998 as a matter of course, and everybody is completely accustomed to it. A few users squawked back then, and I had the "it's because of Y2K" as the excuse that shut them down. Once they got used it, it became a non-issue.
The date is ambiguous, so it is seeing 02 as the day number. Depending on your locale, something like this may suit:
cdate("01-" & Field)
However, it may be best to convert to four digit year, month, day format, which is always unambiguous.
Access seems to be get conduced between MM-YYYY format and MM-DD format. Don't know why it is doing it for dates after the year 2000, but solved it by converting the original string date to full date (01-May-01). Now Access converts the year into 2001 instead of 2010.
If you don't supply a year and the two sets of digits entered into a date field could be a day and month then Access assumes the current year. So your first three dates definitely have a year in them. But the last two don't.
Note that this isn't Access but actually the operating system doing the work. You get the same results in Excel. I had an interesting conversattion with some Microsoft employees on this issue and it's actually OLEAUT32.DLL.