A report by the Scottish Retail Consortium (SRC) and KPMG showed total Scottish sales fell by 2.1%, compared with July last year.
Food sales were down by 4.5% - the category's worst performance since SRC began keeping records 16 years ago.
SRC blamed the fall on wet weather, deflation and price promotions.
However, non-food sales fell by just 0.1%, which was its best performance since last October.
Adjusted for deflation, total Scottish sales decreased by 0.4%, compared with the previous July.
Clothing and footwear was the best performing category in July, with customers responding to end-of-season promotions.
While store sales in the category showed modest growth, online sales were "very strong", according to the monitor.
It said a very wet July, with 63% more rainfall than average for the month, watered down "any willingness to host barbecues".
Retailers with smaller shops fared better than others, thanks to a trend for shopping locally and more frequently.
Earlier this week, SRC called for action from "government at all levels" to stem a drop in shoppers and a rise in the number of vacant shops in Scotland.
SRC director David Lonsdale said: "This is a somewhat insipid set of figures with retail sales in Scotland in July notching down 0.4% compared to the same period last year, once falling shop price inflation is taken into account.
"There was a further and stark polarisation in the sales performance of non-food and grocery items, with sales of the former rising at their fastest rate since October."
He added: "The continuing lean period for grocery retailers won't have been helped by a dearth of sporting successes this summer which often help drive celebratory purchases of food and drink, or the lack of sales of barbeque-related fayre."
A slump in grocery sales acted as a drag on the retail sector's performance in Scotland last month, according to new figures.