I was doing a task this morning which will need to find the rate category a resource belongs to, each resource category has a rate and the resource has its own rate. what I need to do is use the individual rate to match the resource category's rate and find the nearest one.
the resourcecategoryBands table has the following fields: ResourceCategoryCode, Rate
after some thinking, I came up with the following solution:
select top 1 @ResourceCategoryCode = ResourceCategoryCode from ResourceCategoryBands where CategoryType = 'FEES' order by abs(Rate-@IndividualRate)
bingo!
Subscribe to:
Post Comments (Atom)
Elevating LLM Deployment with FastAPI and React: A Step-By-Step Guide
In a previous exploration , I delved into creating a Retrieval-Augmented-Generation (RAG) demo, utilising Google’s gemma model, Hugging ...
-
Error 15401: Windows NT user or group '%s' not found. Check the name again. SELECT name FROM syslogins WHERE sid = SUSER_SID ('Y...
-
start /wait D:\Servers\setup.exe /qn VS=[VIRTUALSERVER] INSTANCENAME=[MSSQLSERVER] REINSTALL=SQL_Engine REBUILDDATABASE=1 ADMINPASSWORD=[CUR...
-
Finally, it is time. E4SE 811 and eBackoffice 736 will replace our current 810b/735a environment after staying so many years. Just got the n...
No comments:
Post a Comment