当前位置:首页
开发技术指南» 文章正文
    引言:

 ·vfp的问题    »显示摘要«
    摘要: 1、我在数据表里设定了一个char型数据记录日期(因为有的日期没有具体的日,只有年月)怎么取出这个日期中的年,例如我想要1941年以前的记录,记录中有1932.4这样的记录。 2、我在打印报表的时候,在预览中是正常的,可是在打印过程中,在第二页总是出现打印错误,错误是第二页的每行第5和第6个字节的地方总是重叠在一起,第一页正常。 例如: 本来应该是 姓名 王久但 变成 名 姓 但 ......
 ·如何判断文件已经打开    »显示摘要«
    摘要: 我用fopen方式打开的。 ......


帮我看看这个sql,在sql server里没问题,但在access执行不了

insert   into   table1(id,field1)   (select   id,string   from   table2   where     table2field2   in   (select   id   from   table3   where   table3field2=11))  
   
  只有select   id,string   from   table2   where     table2field2   in   (select   id   from   table3   where   table3field2=11)这一段可以执行,但整个sql在access里通过不了,但在sql   server里没问题,应该怎么改?

NO.1   作者: gmlxf

先得到  
  select   id   from   table2   where   table2field2   in   (select   id   from   table3   where   table3field2=11)  
   
  存为一个变量id  
   
  然后  
  sql="insert   into   table1(id,field1)   values("   &   id   &   ",string)"  
   
  我不知道你的语法,原来应该是这样。

NO.2   作者: victorycyz

支持这种语法。  
   
  报什么错?

NO.3   作者: Fanks

这样写:  
  insert   into   table1(id,field1)   select   id,string   as   field1   from   table2   where     table2field2   in   (select   id   from   table3   where   table3field2=11))

NO.4   作者: Fanks

最后一个括号去掉

NO.5   作者: gmlxf

支持的啊,哈哈,我没有用过多少,不知道,抱歉。  
   
  支持那就应该是:  
  insert   into   table1(id,field1)   select   id,string   from   table2   where     table2field2   in   (select   id   from   table3   where   table3field2=11)  
 


    摘要: <html> <head> <meta http-equiv="content-language" content="zh-cn"> <meta name="generator" content="microsoft frontpage 5.0"> <met......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE