Daily Updates for Website Variable

As a newcomer to .NET development, I am currently working on creating a basic display site.

My goal is to extract the count of incomplete orders from a database at the beginning of each day and keep this number consistent throughout the day:

(finished / original unfinished orders)

The quantity of "unfinished orders" fluctuates as new orders are completed. Caching this data could lead to different numbers being displayed to users based on when they access the script.

I aim for every user to view the same initial daily total and have it reset nightly. How can I achieve this?

Answer №1

If you're looking for a solution, there are multiple paths you could take. One of the simplest approaches would involve recording the date a particular order is completed along with the order itself. By doing this, you can easily retrieve all orders that have been completed after a certain date or haven't been completed at all.
This method ensures that all orders are counted, even if they were completed on the current day. This way, you'll consistently have an updated list of orders every day - unless new orders are added into the system, which will increase the count.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The integration of ASPNetSpell Spell Checker with CKEditor 3 is not functioning properly on Chrome browsers

In my efforts to incorporate ASPNetSpell's spell checker () into CKEditor (), I have encountered some unexpected behavior across different browsers - IE 8+, FireFox 12, and Chrome 18.0.1025.152m. The issue seems to be that in Chrome, ASPNetSpell is u ...

Displaying and Concealing Divisions

My journey to showing/hiding divs began with piecing together a series of questions: $(document).ready(function(){ $('.box').hide(); $('#categories').onMouseOver(function() { $('.box').hide(); $('#div' + ...

Guide on generating a PDF on the client side and opening it in a new browser tab using AngularJS

In need of assistance with creating a PDF file on the client side using AngularJS and downloading it in a new tab on the browser. Any suggestions on how to achieve this task? ...

What is the best way to change the name of a child object within a clone in three.js? (renaming child objects within clones)

I have designed a 3D model using different elements: ParentObject-001.name = 'ParentObject-001'; ChildObjectA-001.name = 'ChildObjectA-001'; ChildObjectB-001.name = 'ChildObjectB-001'; Then, I combined them with: ParentObject ...

Gaining entry to a JSON object within an array

I've completed various courses on JSON and put in a lot of effort to troubleshoot this bug. However, it seems that my question is too specific and I require a practical example. JSON { "date": "2017-10-15", "league": "NHL", "odds": "spreads", ...

Sorting prices in descending order using Expedia API

Is there a way to arrange prices in descending order using the response.hotelList[i].lowRate? The provided code is as follows: success: function (response) { var bil = 1; var hotel_size = response.hotelList.length; $('#listD ...

One centralized location for handling both page rendering and ajax requests

One access point to my website is through the URL: http://mysite.com/index.php?this=that&andthis=that. This URL serves as the entry point for various tasks like displaying pages, form submissions, and ajax calls which are then routed to the relevant ta ...

Error: The variable 'err' is undefined in the mongoose mongodb code

Every time I try to execute this code, an error pops up stating that err is undefined Below is the code snippet causing the issue: app.post('/tinder/cards', (req, res) => { const dbCard = req.body; Cards.create(dbCard, (err, data) => { ...

Having trouble making the swing effect trigger on mouseover but not on page load

I am trying to achieve a swinging effect on mouseover only, not on page load. Below is the JS code I have: (function swing() { var ang = 20, dAng = 10, ddAng = .5, dir = 1, box = document.getElementById("box"); (function setAng(ang){ ...

Maintain Open State of Toggle Drop Down Menu

Having an issue with the toggle down menu or list on my webpage. The problem is that the menu is constantly open (the #text_box) when the page loads. My intention was for it to be closed initially, and then open only when the user clicks on the 'Ope ...

Fetch external navigation and refresh hyperlinks

After spending an hour searching on Google without finding a solution to my problem, I decided to reach out here for help. Currently, I have a site hosted on a CMS platform and recently created a WordPress blog on a subdomain on a new server. Unfortunatel ...

How to use expressjs to fetch an image from a URL and show it on a webpage

I am currently running an image API from my home server, and I am working on creating a cloud-hosted page that will retrieve the image in the backend and display it, adding a layer of abstraction. My goal is to achieve the following: index.js var express ...

Utilize Dropzone to easily transfer and store documents on Google Drive

Here is the code I am currently using for the upload task: $imagesDropzone.dropzone init: -> this.on 'sending', (file, xhr) -> xhr.setRequestHeader 'Content-Type', file.type url: 'https://www.googleapis.com/up ...

Adjust the position of the bootstrap tooltip dynamically

I attempted to modify the positioning of a tooltip dynamically, but unfortunately, it did not yield the desired results. <input type="text" id="sample" title="Tip"> <button name="change me" id="changeBtn">Change Tool Tip!</button> Here ...

What is the best NoSQL database for storing logs?

Have you ever logged to NoSQL databases for scalable applications before? I recently looked into using NoSQL databases for logging and discovered that MongoDB is a popular choice. Additionally, I came across log4mongo-net, which appears to be a user-friend ...

Inexperienced individual asks: 'Is it possible to accomplish this task using Dojo and Ajax?'

On my website, there is a feature that sends an initial request to a web service. Once this request is sent, the user has to wait for a specific amount of time before being able to send a second request. During this waiting period, I would like a countdo ...

Retrieve the expansive offset label for a time zone utilizing moment-timezone

The luxon library enhances the ability to retrieve the offsetNameLong based on the timezone ianaName, which gives a localized translated zone name. For example: DateTime.local().setLocale("en-US").setZone("America/Los_Angeles").offsetNa ...

Leveraging variables within a Regex query in MongoDB using JavaScript

I am trying to locate a specific row in MongoDB using OR and I need to include a JavaScript variable inside the regex. However, when I do this, the query returns null. By replacing /${oriFilename}/ with my file name like "CB0123456781_20210604165222", the ...

Tips for using NodeJS with a MySQL database

Hello everyone, I'm new to this community so please bear with me if my question seems too simplistic. I've been tasked with a basic web project for one of my courses and will be using NodeJS+MySQL along with VS Code which has caught my eye. Howe ...

Display a flash message to the user indicating the status of a fetch/ajax request

I currently have an application that relies on the fetch API for AJAX operations related to CRUD functionality. After a successful or failed operation, my server returns a response containing an array of messages indicating success or errors, such as: [&ap ...