Unable to get the Query Results - mysql

i am a newbie to SQL. i am not able to figure out what is the solution to this question where i have to filter a query through date.
Please have a look at this image.
Please tell me Where am i doing it wrong.
thanks

There is a sentence appointing to what you are doing wrong. In this case, it is a typo: date is missing 0.

Your date should be 2015-10-01. You're missing a zero in the day portion.

Related

Why is my datediff formula not working?

Good day,
I'm trying to get the difference of months between two different fields. I understand that the "datediff" function should meet my needs. However I am receiving an error. Is my syntax incorrect?
=datediff("mm", Fields!MaturityDate.Value, Fields!DateLastActive.Value)
Thank you!
Use datediff(DateInterval.Month, Fields!MaturityDate.Value, Fields!DateLastActive.Value) instead.

isnull in SSRS expressions

How to use this formula in ssrs-expression
=NOT(isnull({Command.AAID})) or NOT(isnull({Command.HDomain}))
or NOT(isnull({Command.Adomain}))
Thanks.
I think what you're trying to do is display data based on whether or not a field has data in it or not? You can always use an IIF statement with ISNOTHING. See below for the expression.
=IIf(IsNothing(Field!Whatever),0,Field!Whatever)
If that doesn't answer your question, let me know.
So to convert Crystal formula to SSRS-Expression,
You need to write expression like below,
=IIF(Not(IsNothing(Field!AAID)) OR Not(IsNothing(Field!HDomain)) OR NOt(IsNothing(Field!Adomain)),"TruePart","FalsePart")
This expression will work for you!

=WeekdayName(weekday(Today())) gives me tomorrow

I have noticed with one of my reports (SSRS), when I add weekdayname, that tomorrow's value appears.
I tested this by adding a textbox with =WeekdayName(weekday(Today())) in it. I have just run this (on a Monday) and it is saying Tuesday. So clearly it's one day out.
Does anyone know how I can go about rectifying this? I can get round it in reports by adding an expression but I suspect there's some deeper problem that I would like to rectify.
Any advice would be much appreciated.
Try specifying the first day of the week in the Weekday function to be determined by the system settings.
=WeekdayName(Weekday(Today(),FirstDayOfWeek.System))

access iif query do nothing when false

My situation/problem:
TableA
id, postalcode, region
Criteria for the field i want to add value in (postalcode):
=IIf([tableA.Region]="Chicago","60064",[postalcode])
What i need to accomplish is an iif-query where:
In the field postalcode I check in the criteria if the field region equals Chicago. If so fill up the field with postalcode 60064 if not DO NOTHING
For the do nothing part I'm using the fields name, this is wrong?
am i using the criteria in the right field (the field i want to add?)
I'm using a selection query?
As you can see i'm a noob in access queries...
Can somebody give me the right iff statement?
Thx in advance,
D
I'll suggest you bracket table.Region differently, or eliminate the brackets there entirely.
=IIf([tableA].[Region]="Chicago","60064",[postalcode])
=IIf(tableA.Region="Chicago","60064",[postalcode])
If that doesn't fix the problem you're trying to solve, tell us more about the problem. If you're getting an error message, tell us what it says.
Taking a wild guess, that code as a field expression in a query will not give you an editable column in the query result set. If you want to pre-load a column value based on your criteria, but then allow the user to change the value, use a form. In the form's On Current event, load the value as you wish.
This is a dead old post but I think this was what you wanted:
=Like IIf([tableA.Region]="Chicago","60064",'*')
As far as I can understand,
if not DO NOTHING
You need to return nothing if the condition is false.
What you need is the WHERE clause instead of IIF
If I'm understanding your question correctly, you want a NULL value in Postal Code if it's not Chicago?
=IIf([tableA].[Region]="Chicago","60064","")
Please add another IIF query as OR
IIf([Forms]![Run_Macro
Form]![ReturnType_DrpDwn]="Monthly",[Forms]![Run_Macro
Form]![Cmb_Per_Ending],#1/1/2010#)
IIf([Forms]![Run_Macro Form]![ReturnType_DrpDwn]="Quarterly",#1/1/2010#,#1/1/2025#)

In Access VBA expression builder, how do I sum a column conditionally?

Let's say I have two fields A and B and one textbox B_input. I would like to set up a query so it sums all entries of column A where B = B_input
Currently I have:
==Sum(IIf([B_input]<>"All",[A],IIf([B_input]<>[B],0,[A])))
I did more testing, it seem the problem is that under Sum(IIF([B_input])), it's not recognizing the value of [B_input], but if I just have IIF([B_input]), it recognize the value just fine, any ideas?
iif([B_input]=="xyz",Sum[A],False)
Might be what you're after but I'm not sure i understood your question properly.
Alternatively, just edit the sql to something like
SELECT(SUM[A]) AS SumOfA FROM [MyTable] HAVING ("B"="xyz");
How about:
=Sum(IIf([B_input]<>"All",[A],0))
Gave up, went with form filtering instead.