Sorry guys - new to this - complete novice.
I am pulling data from a SQL Server from Excel using Microsoft Query.
I'm currently limiting fields to just invoices within a date range using:
=#10/1/2017# And <#10/31/2017#
My date format is:
2017-10-02 00:00:00.000
I run this report many times during the current month - so I need to change the string above when the new, current month, begins.
I'd love for someone to give me the command that will always pull the current month - regardless of the month - thus allowing me to not have to alter the condition when a new month begins.
Thank you in advance.
The question is not so clear but here is what you can try with:
To find today with date and time:
=NOW()
To find the beginning of the month:
=EOMONTH(A2,-1)+1
To find the end of the month:
=EOMONTH(A2,0)
Let me know if this is what you are expecting.
Related
I have an earnings table in my Google Data Studio report from January 21 - YTD.
But what i want is a table that shows me YTM (so this year until last month) Jan-21 til Sep-21 and that dynamicly on 1st Nov, Okt-21 is added to the table, and on 1st dec Nov-21
is added etc.
Because the Total YTD value is other wise too high, due to cost being booked at the end of the month and earnings through the month.
Filters wont let you do it dynamicly,
date range filters same,
always possible to do it manualy with date range but this i cannot ask from my client.
any suggestions??
Kind regards
I found the answer,
i left the question for when someone else wants to do it,
it is actualy simpel fixed by using advanced date filter and then leaving the start date on 1-jan, and end date to today minus 1 month.
this gave me the exact result i needed yt last month
I am using SQL Server Report Builder to generate a weekly report to show the weekdays Monday - Friday and then the relevant dates.
The report pulls the information from a calendar in SharePoint 2016.
Instead I have created 5 columns with static weekdays and the week dates:
The following generates the weekdays:
=IIf(UCase(Format(Fields!Start_Time.Value, "dddd"))="MONDAY",FORMAT(Fields!Start_Time.Value, "h:mm tt ") & FORMAT(Fields!End_Time.Value, "- h:mmtt"),"")
The following generates the week dates:
=FORMAT(Today.addDays(1-weekday(Today,FirstdayOfWeek.Monday)),"dd/MM/yyyy")
Screenshot of the SQL Report
Which means show the date/time of each weekDay otherwise leave blank.
The problem with this approach is that does show all the entries even those of last week ...
The purpose is to show only for current week.
Unfortunately, I am out of ideas and not sure what else can be done?
UPDATE
I have managed to find a way around this :)
The expression needed to be:
=IIf(FORMAT(Fields!Start_Time.Value,"dd/MM/yyyy")=FORMAT(Today.addDays(1-weekday(Today,FirstdayOfWeek.Monday)),"dd/MM/yyyy"),FORMAT(Fields!Start_Time.Value, "h:mmtt ") & FORMAT(Fields!End_Time.Value, "- h:mmtt"),"")
I have a report written in visual studio running on a SQL server 2005 DB.
I want it to automatically apply the day before's date
- start at 00:00:00 and end 23:59:59
From my pic the code I use is
=DateAdd(Dateinterval.day, -1, Now()) for the start date
and for end date I use
=Now()
These values get me a report for the last 24 hours but I want to get the report to run just for the 24 hours of the previous day. How would I do this?
I think you should be using Today() instead of Now().
Both will give today's date, but Today() will not include any time portion.
You should only use one date paramater being yesterday =DateAdd(DateInterval.Day, -1, Today()).
Then to use this your data should be truncated to the date only and filtered to equal this parameter getting yesterday only irrispective of the time.
I have a numeric field in my Oracle database that represents the number of days since Dec 28, 1800. However I am trying to select it (for another application) as the current date it represents. I'm not too familiar with Oracle commands (I'm used to SQL), so I was wondering if anyone could provide some assistance. Thanks.
ex: 77650 = Saturday, August 3, 2013
Firstly, get this out of the way, your life would be easier if you stored dates in a date data-type.
However, to answer your question to add days to a date in Oracle you can use the + operator.
Firstly though you have to have a date so I'll convert the 28th December 1800 into a date using to inbuilt to_date function then add the number. In your case you would want:
select to_date('1800/12/28','yyyy/mm/dd') + 77650 from dual
I've set up a little SQL Fiddle to demonstrate for you.
I am joining some three tables and getting the following values
week_num provision difference
1 34234
2 4583
i need to find the difference between the provision for week_num2-provision for week_num1 similarly provision for week_num1-provision for week_num52 of last year.
Since i have given condition to bring only 2012 data i donno how to bring the 2011 last week data into this table and find the difference.
can anyone please help me with this ?
You need to use the DATEDIFF function to compute the difference between dates in SQL Server: http://msdn.microsoft.com/en-us/library/ms189794.aspx.
It would help if you could provide a simplified schema in order to guide you to the actual query you need.