日期循环/追加查询的无法解释的问题 [英] Unexplainable problem with date loop/ append query

查看:78
本文介绍了日期循环/追加查询的无法解释的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仍然在度假数据库中...


我发现了一些我无法解释的东西......你们可以吗?


ok我有一个程序,基本上(相当漫长的过程)通过ID从表中选择开始日期和结束日期,然后在VB中选择开始日期和结束日期(作为日期)并循环直到sdt> edt这个循环(基本上)按顺序追加每个日期的另一个表信息,直到sdt> edt。


这个工作正常......但是......


i偶然发现它没有......


如果开始日期和结束日期弥合新年(例如31/12/07 - 7/01/08)

那么它不是添加一天它添加了月....(01/01 / 08,01 / 02 / 08,01 / 03/08)


i已经在调试模式下观看过程并且变量设置正确且增量,似乎由于某种原因查询失败...

i确实将变量写为#" sdt #并且喜欢我说它确实正常工作并且vb是正确的...


任何人解释一个?

解决方案

< blockquote>


仍然在度假数据库中...


我发现了一些我无法解释的东西......你们可以吗?


ok我有一个程序,基本上(相当漫长的过程)通过ID从表中选择开始日期和结束日期,然后在VB中选择开始日期和结束日期(作为日期)并循环直到sdt> edt这个循环(基本上)按顺序追加每个日期的另一个表信息,直到sdt> edt。


这个工作正常......但是......


i偶然发现它没有......


如果开始日期和结束日期弥合新年(例如31/12/07 - 7/01/08)

那么它不是添加一天它添加了月....(01/01 / 08,01 / 02 / 08,01 / 03/08)


i已经在调试模式下观看过程并且变量设置正确且增量,似乎由于某种原因查询失败...

i确实将变量写为#" sdt #并且喜欢我说它确实正常工作并且vb是正确的...


任何人解释一个?

展开 | 选择 < span class =codeDivider> | Wrap | 行号


在寻求失败代码的帮助时,实际发布是个好主意你的代码!


Linq ; 0)>



在寻求失败代码的帮助时,实际发布代码是个好主意!


Linq ; 0)>



实际代码很长

i认为我很好地解释了我的问题


但是不幸的是,jaxjagfan的解决方案无法解决问题


所以我的代码基本上(当然是短暂的)

展开 | 选择 | Wrap | 行号

Still duin the holiday database...

and i have discovered something that i cant explain... can you guys?

ok i have a procedure which basically (quite a longwinded process) selects the start date and the enddate from a table by the ID and then in VB selects that start date and end date (as a date) and loops until sdt > edt this loop (basically) appends to another table information for each date sequentially until sdt > edt.

this works fine... however...

i stumbled on a situation whereby it doesnt...

if the start date and end date bridge new year (eg 31/12/07 - 7/01/08)
then rather than add a single day it adds a month....(01/01/08, 01/02/08, 01/03/08)

i have watched the process in debug mode and the variables are set correctly and increment, it seems for some reason that the query fails...
i do have variable written as # " sdt " # and like i say it does work normally and the vb is correct...

any one explain that one?

解决方案

Still duin the holiday database...

and i have discovered something that i cant explain... can you guys?

ok i have a procedure which basically (quite a longwinded process) selects the start date and the enddate from a table by the ID and then in VB selects that start date and end date (as a date) and loops until sdt > edt this loop (basically) appends to another table information for each date sequentially until sdt > edt.

this works fine... however...

i stumbled on a situation whereby it doesnt...

if the start date and end date bridge new year (eg 31/12/07 - 7/01/08)
then rather than add a single day it adds a month....(01/01/08, 01/02/08, 01/03/08)

i have watched the process in debug mode and the variables are set correctly and increment, it seems for some reason that the query fails...
i do have variable written as # " sdt " # and like i say it does work normally and the vb is correct...

any one explain that one?

Expand|Select|Wrap|Line Numbers


When asking for help with code that is failing, it''s a good idea to actually post your code!

Linq ;0)>


When asking for help with code that is failing, it''s a good idea to actually post your code!

Linq ;0)>

well the actual code is quite long
i think i explained my problem quite well

but unfortunately jaxjagfan''s solution doesnt solve the problem

so my code is basically (shortend of course)

Expand|Select|Wrap|Line Numbers


这篇关于日期循环/追加查询的无法解释的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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