UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Dsum Function Returns With Null, Access 2016    
 
   
haxan786
post May 11 2019, 11:57 AM
Post#1



Posts: 6
Joined: 8-May 19



I have built a query with fiscalyear column like

Date ---------- NEO---------- NPCCD ---------- FISCYEAR
1/1/2019------ 299------------300--------------2018-19
1/1/2019------ 299------------300--------------2018-19
4/1/2019------ 299------------300--------------2018-20

Where my fiscalyear start from 3/30/2018 mm/dd/yyyy

In report I have calculated field [FYD] to generate fiscalyear from report date
Formula
Dsum("[NEO]","[Fiscalyear_Q]","[FISCYEAR]=" & Reports![daily_repory]![FYD])

but value returns with empty field.

Kindly assist me in function
This post has been edited by haxan786: May 11 2019, 12:00 PM
Go to the top of the page
 
theDBguy
post May 11 2019, 12:41 PM
Post#2


Access Wiki and Forums Moderator
Posts: 75,505
Joined: 19-June 07
From: SunnySandyEggo


Hi. Since FISCYEAR appears to be Text data, you'll need to enclose the parameter with single quotes. For example:
CODE
Dsum("[NEO]","[Fiscalyear_Q]","[FISCYEAR]='" & Reports![daily_repory]![FYD] & "'")
Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
gemmathehusky
post May 11 2019, 01:50 PM
Post#3


UtterAccess VIP
Posts: 4,668
Joined: 5-June 07
From: UK


100% - I would store your fiscal year as being one or other. Therefore not 2018-2019, but either 2018 OR 2019 - whichever you are most comfortable with. Much easier to manage as an integer.

you can always present it as either of these
ShowYear: [fiscalyear]-1 & "-" & [fiscalyear]
ShowYear: [fiscalyear] & "-" & [fiscalyear]+1

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
haxan786
post May 11 2019, 04:00 PM
Post#4



Posts: 6
Joined: 8-May 19



Thanks I did modification in my fiscalyear function to show numeric value like 201819.

Its working now.

You guys are awesome! thumbup.gif
Go to the top of the page
 
theDBguy
post May 13 2019, 09:42 AM
Post#5


Access Wiki and Forums Moderator
Posts: 75,505
Joined: 19-June 07
From: SunnySandyEggo


Hi. Glad to hear you got it sorted out. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
gemmathehusky
post May 13 2019, 11:28 AM
Post#6


UtterAccess VIP
Posts: 4,668
Joined: 5-June 07
From: UK


Yes - your way works just as well - just much easier with an integer - and you can always display it to suit.

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th June 2019 - 07:41 PM