Question:
help with MS access function?
mmorshed2k
2009-07-21 07:39:49 UTC
I need help wtih couple of functions in Access.

1) In the 'FileSize' column of a table, I have a list of file sizes in bytes, and I need to show them in gigabyte in another column in query.

2) I need to make a new column 'PathType' and if the entries in the pre-existing 'LocationName' column is 'i141' or 'i142' then ACCESS should automatically put "D" for PathType, all the other entries will show "I".

Please tell me how do i write the functions like that, it doesnt have to be those names exactly, you could say X or Y. Thanks!
Three answers:
olmun
2009-07-21 09:42:01 UTC
People differ on their byte to gigabyte conversion. I believe it to be 1073741824 bytes, but check on wiki (or with your report recipient) to confirm what they want.

1) Size_in_gigabytes:[Filesize]/1073741824

2)PathType:iif(LocationName = "i141" or LocationName = "i142","D","I")



To be honest, I forget the exact syntax. I think it is iif, but if not, try if. Also, if the "or" is wrong try iif(or(LocationName = "i141",LocationName = "i142"),"D","I").

Hope this helps
Capt Crasher
2009-07-21 09:27:23 UTC
1) 'FileSize GB: [FileSize]/1073741824



(See http://www.whatsabyte.com/P1/byteconverter.htm)



2) 1st You go into DESIGN VIEW of the table, and add the new colums.



Then You build an UPDATE QUERY based on the table and add the 'PathType' field.

Under Update To: iif([LocationName] in ("i141", "i142"),"D","I")
aurora
2016-11-11 05:51:39 UTC
you want a 0.33 parameter stated as the factors in the experience that your OrderLine question has a standards in it, then you definately ought to be lacking sq. brackets required for merchandise names with areas, as in: DSum("[LineTotal]","[OrderLine question]") in the experience that your question selects the whole table of order lines, then a attainable standards is "OrderNo=" & kinds![frmOrder]![txtOrderNo] the place OrderNo is the sector call along with your order quantity field, frmOrder is the style the place all it is occurring, and txtOrderNo is the call of the administration exhibiting the order quantity. DSum("[LineTotal]","OrderLine question","OrderNo=" & kinds![frmOrder]![txtOrderNo]) desire this hepls


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...