将记录从一个表移动到另一个表以满足critiria之间的日期 [英] Moving Records from one table to another that meet a date between critiria

查看:83
本文介绍了将记录从一个表移动到另一个表以满足critiria之间的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧我认为这个问题应该放在这里看似更多基于SQl代码而不是vb代码。


继承人我的问题我在vb6中有一个带有acees后端的程序,表格发票在Db中有大约38500条记录9并且会上升)这似乎超过了vb数据网格可以显示的限制。当我查看数据网格时,它启动invoice_Id 84而不是1,但现在已经修复了,因为我刚刚执行了一个ASC订单,这样就好了


问题是我想要使用Invoice_Date归档所有发票小于或大于用户输入的两个日期,例如01/01/1997 - > 01/01/2007以dd / mm / yyyy格式


i尝试了许多不同的方法,其中一个有效的方法是我使用循环并搜索每个记录,如果其invoice_date匹配标准。

ok i think this question should go here seeming its more based around SQl code rather than the vb code.

Heres my problem i have a program in vb6 with a acees backend, the table "Invoice" in the Db has about 38500 records 9 and will go up)which seems to be over the limit that a vb data grid can display. As when i view the data grid it starts out invoice_Id 84 rather than 1, but that is now fixed as i just did an Order BY ASC so thats ok

The problem is i want to archive all the invoices with the "Invoice_Date" less than or greater than two dates a user inputs eg 01/01/1997 -> 01/01/2007 in dd/mm/yyyy format

i have tried many different ways of doing this and one that works is my using a loop and searching each record if its invoice_date matches the criteria.

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

推荐答案

在运行INSERT语句后是否提交了提交?
Did you give a commit after running INSERT statement?


我认为这是一个Access问题,而不是SQL-Server。但是t-sql几乎完全一样,所以我会试着给我两分钱。


你有这个代码:

I think this is an Access question, not an SQL-Server. But t-sql are almost identical so I''ll try to give my two cents.

You have this code:

展开 | 选择 | Wrap | 行号



您是否在运行INSERT语句后提交了提交?
Did you give a commit after running INSERT statement?



抱歉,我不知道你的意思:S



这是一个没有INSERT的例子

sorry i dont know what you meen :S


Heres an example without the INSERT

展开 | 选择 | Wrap | 行号


这篇关于将记录从一个表移动到另一个表以满足critiria之间的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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