How i can get weekend date by giving specific date in laravel? - laravel

I am trying to get weekend date of 17-03-2021
Currently in am getting weekend date of current week i want to get by specific date.
Carbon::now()->endOfWeek()->format('d-m-Y')

If Carbon::now()->endOfWeek()->format('d-m-Y') is doing what you want, just not with a specific date, then parse the date you want to base this from:
Carbon::parse('17-03-2021')->endOfWeek()->format('d-m-Y')
Also consider ->nextWeekendDay() and ->previousWeekendDay() as ways to access the weekend.

Related

Dynamic Date Selection Tableau

Here is a sample data that I am working with. I want to make it more dynamic. Meaning, if a user selects a date, I need to display the 7 day, 14 day change based on the selected date. I have created a parameter with the date filter and also created a formula for 7 day change like this : LOOKUP(SUM([Sample]),-7) and LOOKUP(SUM([Sample]),-14)
I tried using these formulas, but it wont work when I filter to a particular date. Any help is appreciated.
Date Sample
7/1/22 491,556
7/2/22 74,027
7/3/22 65,938
7/4/22 74,099
7/5/22 636,580
7/6/22 508,986
7/7/22 630,481
7/8/22 495,756
7/9/22 71,503
7/10/22 64,875
7/11/22 73,174
7/12/22 642,674
7/13/22 517,709
7/14/22 638,848
7/15/22 490,698
7/16/22 68,802

Compare a date column to today's date in dax im not getting the correct output as required

I have column datetimesent through which I will get to know that the schedule is gone for today, so I'm trying to write if else query where if datetimesent is today's date then schedule running else false.
My existing column is is in date format I need to compare it with inbuilt today/now function, but they are in datetime format, I'm not getting the output correct
You can use DATE() function to build date from your timestamp
for example:
DATE(YEAR([YourTimestampColumn]),MONTH([YourTimestampColumn]),DAY([YourTimestampColumn]))

Optional date and month in date field in Laravel

I have a Photo model that contains information about a historical photo, including date of photography. Often we do not know exactly which day the photo has been taken, but only the month or year. Is there some way to solve this without having three database fields for date, month and year.
date("m-Y",strtotime($date));
I think this could work. Let me know if it helped.
You can enter a date with a random day. It will cut it out.

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.

Report Builder Month Function

In report builder how to filter a date field to get the current month? I'm looking for something equivalent to the Today() function (that gets you just today values).
Actually when I use =field.date.value(Today()), I get today date returned. I would like something like that for the current month instead of the current date.
Try this ,where i am getting the month value from the date of birth field.
=Cstr(Month(Fields!DOB.Value))

Resources