cg343725 2016-04-19 13:35 采纳率: 50%
浏览 1363

ASP强制转换整型,求大神帮忙。。。

图片说明
如图,SQL数据库中一个表(TblCharinfoTimeLog)其中的列
我现在用sum积累select sum(usetime) as usetime from TblCharinfoTimeLog where charid='"&123&"'" 算出123的这几天的在线时间的总和

了。
但是我写出了

set rs4 = Server.CreateObject("ADODB.Recordset")
select sum(usetime) as usetime from TblCharinfoTimeLog where charid='"&character&"'"
rs4.open sql2,conn1,1,2
rs4("usetime")=("usetime")-50
rs4.update
写出来了,可是查询了下表中的列123的时间没有被扣除(原本要扣除50分钟),可是查询了下时间却没有减少!!!这个是(where charid='"&character&"'")其中123代表character中的其中一个名称,后面诸如456,789等等,我只是用character取代它了。。我百度了下,说我的是字符串。要强制转换成整型。。
求大神帮忙写个usetime时间扣除的ASP强制转换整型的句子。。感激不尽。。

  • 写回答

3条回答

  • threenewbee 2016-04-19 15:49
    关注

    select sum(usetime) as usetime from TblCharinfoTimeLog where charid='"&character&"'"
    ->
    select sum(usetime) as usetime from TblCharinfoTimeLog where charid="&character

    评论

报告相同问题?

悬赏问题

  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏