需要一个专业的建议 [英] need one professional advice

查看:54
本文介绍了需要一个专业的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个sql数据表. 1.产品,其中包含有关现在有多少产品的数据2.收入表包含产品收入数量和日期信息,最后一个表包含已售产品数据.

我如何向用户显示昨天或两天后或1周或1个月内有多少当前产品.

制作新表以节省日后产品当前数量的好方法吗?

此方法是否正确?
谢谢.

I have three sql data table. 1. products which contains data about how many products is now 2. income table contains product income quantity and date information and last table contains sold product data.

How i can make to show user how much current products was yesterday or two days later or 1 week, or 1 month.

does it good way to make new table which will save product current quantity after day end?

Does this method works correctly?
thanks.

推荐答案

我认为您正在尝试创建销售系统.如果是这样,您可以将Northwind数据库示例与Access数据库一起使用,也可以在google中找到它.


谢谢,
马蒙
I Think you are trying to create sales system. If it is that you can follow Northwind database sample with access database or you can find it in google.


Thanks,
Mamun


尝试:
SELECT * FROM myTable WHERE purchaseDate BETWEEN @STARTDATE AND @ENDDATE

如果您将两个日期作为参数,并记住BETWEEN是包含在内的,则将昨天的STARTDATE设置为0:0:0并选择ENDDATE昨天23:59:59应该可以执行您想要的操作.

If you hand the two dates as parameters, and remember that BETWEEN is inclusive, then make STARTDATE yesterday at 0:0:0 and ENDDATE yesterday at 23:59:59 that should do what you want.


这篇关于需要一个专业的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆